🚧 Add handler for marking replies as known during first start
[Sone.git] / src / test / kotlin / net / pterodactylus / sone / web / notification / NotificationHandlerModuleTest.kt
index 497ae1d..a4ed7af 100644 (file)
@@ -34,7 +34,6 @@ import net.pterodactylus.sone.text.*
 import net.pterodactylus.sone.utils.*
 import net.pterodactylus.util.notify.*
 import org.hamcrest.MatcherAssert.*
-import org.hamcrest.Matchers
 import org.hamcrest.Matchers.*
 import org.mockito.*
 import org.mockito.Mockito.*
@@ -84,6 +83,20 @@ class NotificationHandlerModuleTest {
        }
 
        @Test
+       fun `mark-post-reply-known-during-first-start handler is created as singleton`() {
+               injector.verifySingletonInstance<MarkPostReplyKnownDuringFirstStartHandler>()
+       }
+
+       @Test
+       fun `mark-post-reply-known-during-first-start handler is created with correct action`() {
+               notificationManager.firstStart()
+               val handler = injector.getInstance<MarkPostReplyKnownDuringFirstStartHandler>()
+               val postReply = mock<PostReply>()
+               handler.newPostReply(NewPostReplyFoundEvent(postReply))
+               verify(core).markReplyKnown(postReply)
+       }
+
+       @Test
        fun `sone-locked-on-startup handler is created as singleton`() {
                injector.verifySingletonInstance<SoneLockedOnStartupHandler>()
        }