X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Ftest%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fnotification%2FLocalPostHandlerTest.kt;h=1d97ae8a342ba03a5747f720a002abfdaeb3b888;hp=45be33b70e5caa14c794e269ebb8ae345c73cc64;hb=c7a324e45e46ac629a5a3da5c3458bc66d18938f;hpb=3e2c50ec4555d0d6ce1c78cd9748946e3b5b0924 diff --git a/src/test/kotlin/net/pterodactylus/sone/web/notification/LocalPostHandlerTest.kt b/src/test/kotlin/net/pterodactylus/sone/web/notification/LocalPostHandlerTest.kt index 45be33b..1d97ae8 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/notification/LocalPostHandlerTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/notification/LocalPostHandlerTest.kt @@ -54,15 +54,21 @@ class LocalPostHandlerTest { } @Test - fun `handler adds notification to manager`() { + fun `handler does not add notification to manager for post by remote sone`() { eventBus.post(NewPostFoundEvent(remotePost)) + assertThat(notificationManager.notifications, not(hasItem(notification))) + } + + @Test + fun `handler adds notification to manager`() { + eventBus.post(NewPostFoundEvent(localPost)) assertThat(notificationManager.notifications, contains(notification)) } @Test fun `handler does not add notification during first start`() { notificationManager.firstStart() - eventBus.post(NewPostFoundEvent(remotePost)) + eventBus.post(NewPostFoundEvent(localPost)) assertThat(notificationManager.notifications, not(hasItem(notification))) }