mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-03-12 14:49:56 +01:00
Fix ShutdownSaveTest
This commit is contained in:
parent
2daf3943b7
commit
bede36957b
@ -119,7 +119,8 @@ class ShutdownSaveTest {
|
||||
@Test
|
||||
void sessionsAreNotSavedOnReload() {
|
||||
shutdownStatus = false;
|
||||
underTest.performSave();
|
||||
Optional<Future<?>> future = underTest.performSave();
|
||||
assertTrue(future.isEmpty());
|
||||
|
||||
database.init();
|
||||
assertTrue(database.query(SessionQueries.fetchAllSessions()).isEmpty());
|
||||
@ -127,10 +128,11 @@ class ShutdownSaveTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
void sessionsAreSavedOnServerShutdown() {
|
||||
void sessionsAreSavedOnServerShutdown() throws Exception {
|
||||
shutdownStatus = true;
|
||||
Optional<Future<?>> save = underTest.performSave();
|
||||
assertTrue(save.isPresent());
|
||||
save.get().get(); // Wait for save to be done, test fails without.
|
||||
|
||||
database.init();
|
||||
assertFalse(database.query(SessionQueries.fetchAllSessions()).isEmpty());
|
||||
|
Loading…
Reference in New Issue
Block a user