X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Ftest%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fnotification%2FSoneLockedHandlerTest.kt;fp=src%2Ftest%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fnotification%2FSoneLockedHandlerTest.kt;h=191168ec7d8478fed97ba2dd939994e9a29aa088;hb=c6be19f98cc713a88954c7705495dc6eb775c32f;hp=2daf5c90eabbbcfb632ad7c8a9b610cb2774ddf7;hpb=6d770b3aa761b4432517b4789a980c4ba75ed9fa;p=Sone.git diff --git a/src/test/kotlin/net/pterodactylus/sone/web/notification/SoneLockedHandlerTest.kt b/src/test/kotlin/net/pterodactylus/sone/web/notification/SoneLockedHandlerTest.kt index 2daf5c9..191168e 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/notification/SoneLockedHandlerTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/notification/SoneLockedHandlerTest.kt @@ -44,16 +44,18 @@ class SoneLockedHandlerTest { SoneLockedHandler(notificationManager, notification, executor).also(eventBus::register) } + @AfterTest + fun shutdownExecutor() = executor.shutdown() + @Test - fun `notification is not added during the first five minutes`() { + fun `notification is not added before the command is run`() { eventBus.post(SoneLockedEvent(sone)) assertThat(notificationManager.notifications, emptyIterable()) } @Test - fun `sone is added to notification from command`() { + fun `sone is added to notification immediately`() { eventBus.post(SoneLockedEvent(sone)) - executor.scheduledDelay.single().command.run() assertThat(notification.elements, contains(sone)) }