use new junit api to test exception
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
This commit is contained in:
parent
90527065c0
commit
ebbe2c5843
|
@ -30,7 +30,7 @@ import org.junit.jupiter.api.BeforeEach;
|
|||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.fail;
|
||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
|
||||
/**
|
||||
* InfinispanSessionDataStoreTest
|
||||
|
@ -106,15 +106,7 @@ public class InfinispanSessionDataStoreTest extends AbstractSessionDataStoreTest
|
|||
((InfinispanSessionDataStore)store).setCache(null);
|
||||
|
||||
//test that loading it fails
|
||||
try
|
||||
{
|
||||
store.load("222");
|
||||
fail("Session should be unreadable");
|
||||
}
|
||||
catch (UnreadableSessionDataException e)
|
||||
{
|
||||
//expected exception
|
||||
}
|
||||
assertThrows(UnreadableSessionDataException.class, () -> store.load("222"));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -30,7 +30,7 @@ import org.junit.jupiter.api.BeforeEach;
|
|||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.fail;
|
||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
|
||||
/**
|
||||
* SerializedInfinispanSessionDataStoreTest
|
||||
|
@ -107,15 +107,7 @@ public class SerializedInfinispanSessionDataStoreTest extends AbstractSessionDat
|
|||
((InfinispanSessionDataStore)store).setCache(null);
|
||||
|
||||
//test that loading it fails
|
||||
try
|
||||
{
|
||||
store.load("222");
|
||||
fail("Session should be unreadable");
|
||||
}
|
||||
catch (UnreadableSessionDataException e)
|
||||
{
|
||||
//expected exception
|
||||
}
|
||||
assertThrows(UnreadableSessionDataException.class,() -> store.load("222"));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -38,7 +38,7 @@ import org.junit.jupiter.api.BeforeEach;
|
|||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.fail;
|
||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
|
||||
/**
|
||||
* RemoteInfinispanSessionDataStoreTest
|
||||
|
@ -130,15 +130,7 @@ public class RemoteInfinispanSessionDataStoreTest extends AbstractSessionDataSto
|
|||
((InfinispanSessionDataStore)store).setCache(null);
|
||||
|
||||
//test that loading it fails
|
||||
try
|
||||
{
|
||||
store.load("222");
|
||||
fail("Session should be unreadable");
|
||||
}
|
||||
catch (UnreadableSessionDataException e)
|
||||
{
|
||||
//expected exception
|
||||
}
|
||||
assertThrows(UnreadableSessionDataException.class, () -> store.load("222"));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
Loading…
Reference in New Issue