🚨 Suppress some warnings about unused parameters
[Sone.git] / src / test / kotlin / net / pterodactylus / sone / main / SonePluginTest.kt
index b846522..d1e2cec 100644 (file)
@@ -15,6 +15,7 @@ import net.pterodactylus.sone.web.*
 import net.pterodactylus.sone.web.notification.*
 import org.hamcrest.MatcherAssert.*
 import org.hamcrest.Matchers.*
+import org.junit.experimental.categories.*
 import org.mockito.Mockito.*
 import java.io.*
 import java.util.concurrent.atomic.*
@@ -24,6 +25,7 @@ import kotlin.test.*
  * Unit test for [SonePlugin].
  */
 @Dirty
+@Category(NotParallel::class)
 class SonePluginTest {
 
        private var sonePlugin = SonePlugin { injector }
@@ -100,9 +102,15 @@ class SonePluginTest {
                assertThat(getInjected(NotificationHandler::class.java), notNullValue())
        }
 
+       @Test
+       fun `ticker shutdown is being requested`() {
+               sonePlugin.runPlugin(pluginRespirator)
+               assertThat(getInjected(TickerShutdown::class.java), notNullValue())
+       }
+
        private class FirstStartListener(private val firstStartReceived: AtomicBoolean) {
                @Subscribe
-               fun firstStart(firstStart: FirstStart) {
+               fun firstStart(@Suppress("UNUSED_PARAMETER") firstStart: FirstStart) {
                        firstStartReceived.set(true)
                }
        }
@@ -133,7 +141,7 @@ class SonePluginTest {
 
        private class ConfigNotReadListener(private val configNotReadReceiver: AtomicBoolean) {
                @Subscribe
-               fun configNotRead(configNotRead: ConfigNotRead) {
+               fun configNotRead(@Suppress("UNUSED_PARAMETER") configNotRead: ConfigNotRead) {
                        configNotReadReceiver.set(true)
                }
        }
@@ -177,7 +185,7 @@ class SonePluginTest {
 
        private class StartupListener(private val startupReceived: () -> Unit) {
                @Subscribe
-               fun startup(startup: Startup) {
+               fun startup(@Suppress("UNUSED_PARAMETER") startup: Startup) {
                        startupReceived()
                }
        }
@@ -194,7 +202,7 @@ class SonePluginTest {
 
        private class ShutdownListener(private val shutdownReceived: () -> Unit) {
                @Subscribe
-               fun shutdown(shutdown: Shutdown) {
+               fun shutdown(@Suppress("UNUSED_PARAMETER") shutdown: Shutdown) {
                        shutdownReceived()
                }
        }