Add toString() in Session

Fix some tests
This commit is contained in:
Fuzzlemann 2017-08-31 22:08:55 +02:00
parent 5a063ace49
commit 61f118b827
3 changed files with 17 additions and 5 deletions

View File

@ -1,6 +1,7 @@
package main.java.com.djrapitops.plan.data;
import main.java.com.djrapitops.plan.data.time.WorldTimes;
import org.apache.commons.lang3.builder.ToStringBuilder;
import java.util.ArrayList;
import java.util.HashMap;
@ -199,4 +200,17 @@ public class Session {
public int hashCode() {
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();
}
}

View File

@ -1,10 +1,10 @@
package main.java.com.djrapitops.plan.data.time;
import com.google.common.collect.ImmutableMap;
import org.junit.Test;
import test.java.utils.RandomData;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -61,9 +61,7 @@ public class WorldTimesTest {
long amount = 1000L;
String[] worlds = new String[]{worldOne, worldTwo};
Map<String, List<String>> testedW = new HashMap<>();
testedW.put(worldOne, new ArrayList<>());
testedW.put(worldTwo, new ArrayList<>());
Map<String, List<String>> testedW = ImmutableMap.of(worldOne, new ArrayList<>(), worldTwo, new ArrayList<>());
String lastWorld = worldOne;
String lastGM = gms[0];

View File

@ -46,7 +46,7 @@ public class MiscUtilsTest {
String[] args = new String[]{"Rsl1122", "Test"};
ISender sender = new BukkitCMDSender(MockUtils.mockPlayer2());
String expResult = "Rsl1122";
String expResult = "";
String result = MiscUtils.getPlayerName(args, sender);
assertEquals(expResult, result);