Search in sources :

Example 1 with QuerySvc

use of com.djrapitops.plan.query.QuerySvc 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:");
}
Also used : Locale(com.djrapitops.plan.settings.locale.Locale) ActiveSession(com.djrapitops.plan.gathering.domain.ActiveSession) BaseUser(com.djrapitops.plan.gathering.domain.BaseUser) DBCleanTask(com.djrapitops.plan.storage.upkeep.DBCleanTask) QuerySvc(com.djrapitops.plan.query.QuerySvc) Test(org.junit.jupiter.api.Test)

Aggregations

ActiveSession (com.djrapitops.plan.gathering.domain.ActiveSession)1 BaseUser (com.djrapitops.plan.gathering.domain.BaseUser)1 QuerySvc (com.djrapitops.plan.query.QuerySvc)1 Locale (com.djrapitops.plan.settings.locale.Locale)1 DBCleanTask (com.djrapitops.plan.storage.upkeep.DBCleanTask)1 Test (org.junit.jupiter.api.Test)1