Search in sources :

Example 1 with SessionCache

use of com.djrapitops.plan.gathering.cache.SessionCache in project Plan by plan-player-analytics.

the class BukkitAFKListenerTest method setUp.

@BeforeAll
static void setUp() {
    PlanConfig config = Mockito.mock(PlanConfig.class);
    when(config.get(TimeSettings.AFK_THRESHOLD)).thenReturn(TimeUnit.MINUTES.toMillis(3));
    errorLogger = Mockito.mock(ErrorLogger.class);
    underTest = new BukkitAFKListener(config, errorLogger);
    new SessionCache().cacheSession(TestConstants.PLAYER_ONE_UUID, new ActiveSession(null, null, 0, null, null));
    new SessionCache().cacheSession(TestConstants.PLAYER_TWO_UUID, new ActiveSession(null, null, 0, null, null));
}
Also used : ActiveSession(com.djrapitops.plan.gathering.domain.ActiveSession) BukkitAFKListener(com.djrapitops.plan.gathering.listeners.bukkit.BukkitAFKListener) SessionCache(com.djrapitops.plan.gathering.cache.SessionCache) PlanConfig(com.djrapitops.plan.settings.config.PlanConfig) ErrorLogger(com.djrapitops.plan.utilities.logging.ErrorLogger) BeforeAll(org.junit.jupiter.api.BeforeAll)

Example 2 with SessionCache

use of com.djrapitops.plan.gathering.cache.SessionCache in project Plan by plan-player-analytics.

the class NukkitAFKListenerTest method setUp.

@BeforeAll
static void setUp() {
    PlanConfig config = Mockito.mock(PlanConfig.class);
    when(config.get(TimeSettings.AFK_THRESHOLD)).thenReturn(TimeUnit.MINUTES.toMillis(3));
    errorLogger = Mockito.mock(ErrorLogger.class);
    underTest = new NukkitAFKListener(config, errorLogger);
    new SessionCache().cacheSession(TestConstants.PLAYER_ONE_UUID, new ActiveSession(null, null, 0, null, null));
    new SessionCache().cacheSession(TestConstants.PLAYER_TWO_UUID, new ActiveSession(null, null, 0, null, null));
}
Also used : ActiveSession(com.djrapitops.plan.gathering.domain.ActiveSession) NukkitAFKListener(com.djrapitops.plan.gathering.listeners.nukkit.NukkitAFKListener) SessionCache(com.djrapitops.plan.gathering.cache.SessionCache) PlanConfig(com.djrapitops.plan.settings.config.PlanConfig) ErrorLogger(com.djrapitops.plan.utilities.logging.ErrorLogger) BeforeAll(org.junit.jupiter.api.BeforeAll)

Example 3 with SessionCache

use of com.djrapitops.plan.gathering.cache.SessionCache in project Plan by plan-player-analytics.

the class AFKTrackerTest method setUpAfkTracker.

@BeforeEach
void setUpAfkTracker() {
    PlanConfig config = Mockito.mock(PlanConfig.class);
    afkThreshold = TimeUnit.MINUTES.toMillis(1L);
    when(config.get(TimeSettings.AFK_THRESHOLD)).thenReturn(afkThreshold);
    new SessionCache().cacheSession(playerUUID, new ActiveSession(playerUUID, null, 0, null, null));
    underTest = new AFKTracker(config);
}
Also used : ActiveSession(com.djrapitops.plan.gathering.domain.ActiveSession) SessionCache(com.djrapitops.plan.gathering.cache.SessionCache) PlanConfig(com.djrapitops.plan.settings.config.PlanConfig) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

SessionCache (com.djrapitops.plan.gathering.cache.SessionCache)3 ActiveSession (com.djrapitops.plan.gathering.domain.ActiveSession)3 PlanConfig (com.djrapitops.plan.settings.config.PlanConfig)3 ErrorLogger (com.djrapitops.plan.utilities.logging.ErrorLogger)2 BeforeAll (org.junit.jupiter.api.BeforeAll)2 BukkitAFKListener (com.djrapitops.plan.gathering.listeners.bukkit.BukkitAFKListener)1 NukkitAFKListener (com.djrapitops.plan.gathering.listeners.nukkit.NukkitAFKListener)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1