mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-12-24 10:11:53 +01:00
Fixed tests
This commit is contained in:
parent
5e2c540522
commit
d587892df2
@ -182,14 +182,8 @@ public class Session extends DataContainer implements DateHolder {
|
||||
getValue(SessionKeys.END).orElse(-1L).equals(session.getValue(SessionKeys.END).orElse(-1L)) &&
|
||||
mobKills == session.mobKills &&
|
||||
deaths == session.deaths &&
|
||||
Objects.equals(
|
||||
getValue(SessionKeys.WORLD_TIMES).orElse(null),
|
||||
session.getValue(SessionKeys.WORLD_TIMES).orElse(null)
|
||||
) &&
|
||||
Objects.equals(
|
||||
getValue(SessionKeys.PLAYER_KILLS).orElse(new ArrayList<>()),
|
||||
session.getValue(SessionKeys.PLAYER_KILLS).orElse(new ArrayList<>())
|
||||
);
|
||||
Objects.equals(playerKills, session.playerKills) &&
|
||||
Objects.equals(worldTimes, session.worldTimes);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -252,4 +246,16 @@ public class Session extends DataContainer implements DateHolder {
|
||||
|
||||
return theWorld + " (" + Formatters.percentage().apply(quotient) + ")";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Session{" +
|
||||
"sessionStart=" + sessionStart +
|
||||
", worldTimes=" + worldTimes +
|
||||
", playerKills=" + playerKills +
|
||||
", mobKills=" + mobKills +
|
||||
", deaths=" + deaths +
|
||||
", afkTime=" + afkTime +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
@ -1,10 +1,7 @@
|
||||
package com.djrapitops.plan.system.cache;
|
||||
|
||||
import com.djrapitops.plan.data.container.Session;
|
||||
import org.junit.Before;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.ClassRule;
|
||||
import org.junit.Test;
|
||||
import org.junit.*;
|
||||
import org.junit.rules.TemporaryFolder;
|
||||
import utilities.TestConstants;
|
||||
import utilities.mocks.SystemMockUtil;
|
||||
@ -36,6 +33,11 @@ public class SessionCacheTest {
|
||||
sessionCache.cacheSession(uuid, session);
|
||||
}
|
||||
|
||||
@After
|
||||
public void tearDown() {
|
||||
SessionCache.clear();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAtomity() {
|
||||
SessionCache reloaded = new SessionCache(null);
|
||||
|
Loading…
Reference in New Issue
Block a user