Skip to content

Commit

Permalink
web-session test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
rymsha committed Oct 30, 2019
1 parent e795c0b commit bd6fc4c
Showing 1 changed file with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ void load()

@Test
void loadWithException()
throws Exception
{
when( cache.get( anyString() ) ).thenThrow( new RuntimeException( "Something happened" ) );

Expand All @@ -77,7 +76,6 @@ void loadWithException()

@Test
void delete()
throws Exception
{
when( cache.remove( anyString() ) ).thenReturn( true );

Expand All @@ -87,7 +85,6 @@ void delete()

@Test
void doStore()
throws Exception
{
final SessionData sessionData = new SessionData( "123", null, null, 0, 0, 0, 0 );

Expand Down Expand Up @@ -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 ) );

Expand All @@ -161,7 +156,6 @@ void doGetExpired()

@Test
void doGetExpiredEmpty()
throws Exception
{
final Set<String> expiredSessionIds = store.doGetExpired( new HashSet<>() );
assertEquals( new HashSet<>(), expiredSessionIds );
Expand Down

0 comments on commit bd6fc4c

Please sign in to comment.