mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-12-26 19:17:43 +01:00
Add toString() in Session
Fix some tests
This commit is contained in:
parent
5a063ace49
commit
61f118b827
@ -1,6 +1,7 @@
|
|||||||
package main.java.com.djrapitops.plan.data;
|
package main.java.com.djrapitops.plan.data;
|
||||||
|
|
||||||
import main.java.com.djrapitops.plan.data.time.WorldTimes;
|
import main.java.com.djrapitops.plan.data.time.WorldTimes;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@ -199,4 +200,17 @@ public class Session {
|
|||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hash(sessionStart, sessionID, worldTimes, sessionEnd, playerKills, mobKills, deaths);
|
return Objects.hash(sessionStart, sessionID, worldTimes, sessionEnd, playerKills, mobKills, deaths);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return new ToStringBuilder(this)
|
||||||
|
.append("sessionStart", sessionStart)
|
||||||
|
.append("sessionID", sessionID)
|
||||||
|
.append("worldTimes", worldTimes)
|
||||||
|
.append("sessionEnd", sessionEnd)
|
||||||
|
.append("playerKills", playerKills)
|
||||||
|
.append("mobKills", mobKills)
|
||||||
|
.append("deaths", deaths)
|
||||||
|
.toString();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
package main.java.com.djrapitops.plan.data.time;
|
package main.java.com.djrapitops.plan.data.time;
|
||||||
|
|
||||||
|
import com.google.common.collect.ImmutableMap;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import test.java.utils.RandomData;
|
import test.java.utils.RandomData;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@ -61,9 +61,7 @@ public class WorldTimesTest {
|
|||||||
long amount = 1000L;
|
long amount = 1000L;
|
||||||
String[] worlds = new String[]{worldOne, worldTwo};
|
String[] worlds = new String[]{worldOne, worldTwo};
|
||||||
|
|
||||||
Map<String, List<String>> testedW = new HashMap<>();
|
Map<String, List<String>> testedW = ImmutableMap.of(worldOne, new ArrayList<>(), worldTwo, new ArrayList<>());
|
||||||
testedW.put(worldOne, new ArrayList<>());
|
|
||||||
testedW.put(worldTwo, new ArrayList<>());
|
|
||||||
|
|
||||||
String lastWorld = worldOne;
|
String lastWorld = worldOne;
|
||||||
String lastGM = gms[0];
|
String lastGM = gms[0];
|
||||||
|
@ -46,7 +46,7 @@ public class MiscUtilsTest {
|
|||||||
String[] args = new String[]{"Rsl1122", "Test"};
|
String[] args = new String[]{"Rsl1122", "Test"};
|
||||||
ISender sender = new BukkitCMDSender(MockUtils.mockPlayer2());
|
ISender sender = new BukkitCMDSender(MockUtils.mockPlayer2());
|
||||||
|
|
||||||
String expResult = "Rsl1122";
|
String expResult = "";
|
||||||
String result = MiscUtils.getPlayerName(args, sender);
|
String result = MiscUtils.getPlayerName(args, sender);
|
||||||
|
|
||||||
assertEquals(expResult, result);
|
assertEquals(expResult, result);
|
||||||
|
Loading…
Reference in New Issue
Block a user