setField(node, "clientCore", clientCore)
whenever(pluginRespirator.node).thenReturn(node)
setField(clientCore, "uskManager", uskManager)
+ setField(clientCore, "clientContext", mock<ClientContext>())
}
@Test
private class FirstStartListener(private val firstStartReceived: AtomicBoolean) {
@Subscribe
- fun firstStart(firstStart: FirstStart) {
+ fun firstStart(@Suppress("UNUSED_PARAMETER") firstStart: FirstStart) {
firstStartReceived.set(true)
}
}
private class ConfigNotReadListener(private val configNotReadReceiver: AtomicBoolean) {
@Subscribe
- fun configNotRead(configNotRead: ConfigNotRead) {
+ fun configNotRead(@Suppress("UNUSED_PARAMETER") configNotRead: ConfigNotRead) {
configNotReadReceiver.set(true)
}
}
@Test
- fun `config-not-read event is sent to event bus when new config is true`() {
+ fun `config-not-read event is sent to event bus when config file is invalid`() {
File("sone.properties").deleteAfter {
writeText("Invalid")
val configNotReadReceived = AtomicBoolean()
}
@Test
- fun `config-not-read event is not sent to event bus when first start is true`() {
+ fun `config-not-read event is not sent to event bus when config file does not exist`() {
File("sone.properties").delete()
val configNotReadReceived = AtomicBoolean()
runSonePluginWithRealInjector {
}
@Test
- fun `config-not-read event is not sent to event bus when new config is false`() {
+ fun `config-not-read event is not sent to event bus when config file is valid`() {
File("sone.properties").deleteAfter {
writeText("# comment")
val configNotReadReceived = AtomicBoolean()
private class StartupListener(private val startupReceived: () -> Unit) {
@Subscribe
- fun startup(startup: Startup) {
+ fun startup(@Suppress("UNUSED_PARAMETER") startup: Startup) {
startupReceived()
}
}
private class ShutdownListener(private val shutdownReceived: () -> Unit) {
@Subscribe
- fun shutdown(shutdown: Shutdown) {
+ fun shutdown(@Suppress("UNUSED_PARAMETER") shutdown: Shutdown) {
shutdownReceived()
}
}