import net.pterodactylus.util.logging.*
import net.pterodactylus.util.version.Version
import java.io.*
+import java.util.concurrent.*
+import java.util.concurrent.Executors.*
import java.util.logging.*
+import javax.inject.*
+import javax.inject.Singleton
open class SoneModule(private val sonePlugin: SonePlugin, private val eventBus: EventBus) : AbstractModule() {
})
}
+ @Provides
+ @Singleton
+ @Named("notification")
+ fun getNotificationTicker(): ScheduledExecutorService =
+ newSingleThreadScheduledExecutor()
+
private val logger: Logger = Logging.getLogger(javaClass)
}
import org.hamcrest.Matchers.*
import org.mockito.Mockito.*
import java.io.*
+import java.util.concurrent.*
import java.util.concurrent.atomic.*
import kotlin.test.*
injector.verifySingletonInstance<WebOfTrustConnector>()
}
+ @Test
+ fun `notification ticker is created as singleton`() {
+ injector.verifySingletonInstance<ScheduledExecutorService>(named("notification"))
+ }
+
}