X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Ftest%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fnotification%2FNewRemotePostHandlerTest.kt;fp=src%2Ftest%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fnotification%2FNewRemotePostHandlerTest.kt;h=805731d69e316a321ed0f79309fe444775796b30;hp=fc04b8b1b40cd4392f4a1fb6ca0b54ad1e65d94e;hb=5aaa1e1dc761fa0c8b6745b7b022c0a19d248c68;hpb=8d5853b15e60fcea8408b10e4efa64467c70bdec diff --git a/src/test/kotlin/net/pterodactylus/sone/web/notification/NewRemotePostHandlerTest.kt b/src/test/kotlin/net/pterodactylus/sone/web/notification/NewRemotePostHandlerTest.kt index fc04b8b..805731d 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/notification/NewRemotePostHandlerTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/notification/NewRemotePostHandlerTest.kt @@ -68,6 +68,20 @@ class NewRemotePostHandlerTest { assertThat(remotePostHandlerTest.notifications, not(hasItem(notification))) } + @Test + fun `handler removes post from notification if post is removed`() { + notification.add(remotePost) + remotePostHandlerTest.sendEvent(PostRemovedEvent(remotePost)) + assertThat(notification.elements, not(hasItem(remotePost))) + } + + @Test + fun `handler removes post from notification if post is marked as known`() { + notification.add(remotePost) + remotePostHandlerTest.sendEvent(MarkPostKnownEvent(remotePost)) + assertThat(notification.elements, not(hasItem(remotePost))) + } + } private val remoteSone: Sone = IdOnlySone("remote-sone")