use of com.djrapitops.plan.gathering.domain.FinishedSession in project Plan by plan-player-analytics.
the class SessionQueriesTest method sessionsAreStoredWithAllData.
@Test
default void sessionsAreStoredWithAllData() {
prepareForSessionSave();
FinishedSession session = RandomData.randomSession(serverUUID(), worlds, playerUUID, player2UUID);
execute(DataStoreQueries.storeSession(session));
forcePersistenceCheck();
Map<ServerUUID, List<FinishedSession>> sessions = db().query(SessionQueries.fetchSessionsOfPlayer(playerUUID));
List<FinishedSession> savedSessions = sessions.get(serverUUID());
assertNotNull(savedSessions);
assertEquals(1, savedSessions.size());
assertEquals(session, savedSessions.get(0));
}
use of com.djrapitops.plan.gathering.domain.FinishedSession in project Plan by plan-player-analytics.
the class SessionQueriesTest method testKillTableGetKillsOfServer.
@Test
default void testKillTableGetKillsOfServer() {
prepareForSessionSave();
FinishedSession session = RandomData.randomSession(serverUUID(), worlds, playerUUID, player2UUID);
List<PlayerKill> expected = session.getExtraData(PlayerKills.class).map(PlayerKills::asList).get();
execute(DataStoreQueries.storeSession(session));
forcePersistenceCheck();
Map<ServerUUID, List<FinishedSession>> sessions = db().query(SessionQueries.fetchSessionsOfPlayer(playerUUID));
List<FinishedSession> savedSessions = sessions.get(serverUUID());
assertNotNull(savedSessions);
assertFalse(savedSessions.isEmpty());
List<PlayerKill> got = savedSessions.get(0).getExtraData(PlayerKills.class).map(PlayerKills::asList).get();
assertEquals(expected, got);
}
Aggregations