use of com.djrapitops.plan.storage.upkeep.DBCleanTask in project Plan by plan-player-analytics.
the class DatabaseTest method cleanDoesNotCleanActivePlayers.
@Test
default void cleanDoesNotCleanActivePlayers() {
saveUserOne();
saveTwoWorlds();
long sessionStart = System.currentTimeMillis();
ActiveSession session = new ActiveSession(playerUUID, serverUUID(), sessionStart, worlds[0], "SURVIVAL");
execute(DataStoreQueries.storeSession(session.toFinishedSession(sessionStart + 22345L)));
TestPluginLogger logger = new TestPluginLogger();
new DBCleanTask(config(), new Locale(), dbSystem(), new QuerySvc(config(), dbSystem(), serverInfo(), null), serverInfo(), logger, null).cleanOldPlayers(db());
Collection<BaseUser> found = db().query(BaseUserQueries.fetchServerBaseUsers(serverUUID()));
assertFalse(found.isEmpty(), "All users were deleted!! D:");
}
Aggregations