From bd6fc4c5a0efc2de7e1d60564c2c859e4f55049d Mon Sep 17 00:00:00 2001 From: Sergey Rymsha Date: Wed, 30 Oct 2019 14:20:58 +0100 Subject: [PATCH] web-session test fix --- .../impl/ignite/IgniteSessionDataStoreTest.java | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/modules/web/web-session/src/test/java/com/enonic/xp/web/session/impl/ignite/IgniteSessionDataStoreTest.java b/modules/web/web-session/src/test/java/com/enonic/xp/web/session/impl/ignite/IgniteSessionDataStoreTest.java index e604fb5e33e..8f958759c91 100644 --- a/modules/web/web-session/src/test/java/com/enonic/xp/web/session/impl/ignite/IgniteSessionDataStoreTest.java +++ b/modules/web/web-session/src/test/java/com/enonic/xp/web/session/impl/ignite/IgniteSessionDataStoreTest.java @@ -67,7 +67,6 @@ void load() @Test void loadWithException() - throws Exception { when( cache.get( anyString() ) ).thenThrow( new RuntimeException( "Something happened" ) ); @@ -77,7 +76,6 @@ void loadWithException() @Test void delete() - throws Exception { when( cache.remove( anyString() ) ).thenReturn( true ); @@ -87,7 +85,6 @@ void delete() @Test void doStore() - throws Exception { final SessionData sessionData = new SessionData( "123", null, null, 0, 0, 0, 0 ); @@ -129,22 +126,20 @@ void existsWithExpiryTime() @Test void isPassivating() - throws Exception { assertTrue( store.isPassivating() ); } @Test void doGetExpired() - throws Exception { final SessionData sessionData = new SessionData( "123", "cpath", "vhost", 0, 0, 0, 0 ); - sessionData.setExpiry( System.currentTimeMillis() - 10000 ); + sessionData.setExpiry( System.currentTimeMillis() + 10000 ); sessionData.setLastNode( NODE ); when( cache.get( eq( getCacheKey( "123" ) ) ) ).thenReturn( new IgniteSessionData( sessionData ) ); final SessionData sessionData2 = new SessionData( "456", "cpath", "vhost", 0, 0, 0, 0 ); - sessionData2.setExpiry( System.currentTimeMillis() - 1000000000 ); + sessionData2.setExpiry( System.currentTimeMillis() + 10000000000L ); sessionData2.setLastNode( "OTHER" ); when( cache.get( eq( getCacheKey( "456" ) ) ) ).thenReturn( new IgniteSessionData( sessionData2 ) ); @@ -161,7 +156,6 @@ void doGetExpired() @Test void doGetExpiredEmpty() - throws Exception { final Set expiredSessionIds = store.doGetExpired( new HashSet<>() ); assertEquals( new HashSet<>(), expiredSessionIds );