projects
/
Sone.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
🔀 Merge branch 'release/v82'
[Sone.git]
/
src
/
test
/
kotlin
/
net
/
pterodactylus
/
sone
/
web
/
notification
/
LocalPostHandlerTest.kt
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
..
22648b5
100644
(file)
--- a/
src/test/kotlin/net/pterodactylus/sone/web/notification/LocalPostHandlerTest.kt
+++ b/
src/test/kotlin/net/pterodactylus/sone/web/notification/LocalPostHandlerTest.kt
@@
-1,5
+1,5
@@
/**
/**
- * Sone -
NewLocalPostHandlerTest.kt - Copyright © 2019
David ‘Bombe’ Roden
+ * Sone -
LocalPostHandlerTest.kt - Copyright © 2019–2020
David ‘Bombe’ Roden
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@
-54,15
+54,21
@@
class LocalPostHandlerTest {
}
@Test
}
@Test
- fun `handler
adds notification to manager
`() {
+ fun `handler
does not add notification to manager for post by remote sone
`() {
eventBus.post(NewPostFoundEvent(remotePost))
eventBus.post(NewPostFoundEvent(remotePost))
+ assertThat(notificationManager.notifications, not(hasItem<Notification>(notification)))
+ }
+
+ @Test
+ fun `handler adds notification to manager`() {
+ eventBus.post(NewPostFoundEvent(localPost))
assertThat(notificationManager.notifications, contains<Notification>(notification))
}
@Test
fun `handler does not add notification during first start`() {
notificationManager.firstStart()
assertThat(notificationManager.notifications, contains<Notification>(notification))
}
@Test
fun `handler does not add notification during first start`() {
notificationManager.firstStart()
- eventBus.post(NewPostFoundEvent(
remote
Post))
+ eventBus.post(NewPostFoundEvent(
local
Post))
assertThat(notificationManager.notifications, not(hasItem<Notification>(notification)))
}
assertThat(notificationManager.notifications, not(hasItem<Notification>(notification)))
}