package net.pterodactylus.sone.web.notification
import net.pterodactylus.sone.freenet.wot.*
+import net.pterodactylus.sone.text.*
import javax.inject.*
/**
configNotReadHandler: ConfigNotReadHandler,
startupHandler: StartupHandler,
webOfTrustPinger: WebOfTrustPinger,
- webOfTrustHandler: WebOfTrustHandler
+ webOfTrustHandler: WebOfTrustHandler,
+ soneMentionDetector: SoneMentionDetector
)
import net.pterodactylus.sone.freenet.wot.*
import net.pterodactylus.sone.main.*
import net.pterodactylus.sone.notify.*
+import net.pterodactylus.sone.text.*
import net.pterodactylus.util.notify.*
import java.util.concurrent.*
import java.util.concurrent.TimeUnit.*
bind<ConfigNotReadHandler>().asSingleton()
bind<StartupHandler>().asSingleton()
bind<WebOfTrustHandler>().asSingleton()
+ bind<SoneMentionDetector>().asSingleton()
}
@Provides
import net.pterodactylus.sone.main.*
import net.pterodactylus.sone.notify.*
import net.pterodactylus.sone.test.*
+import net.pterodactylus.sone.text.*
import net.pterodactylus.sone.utils.*
import net.pterodactylus.util.notify.*
import org.hamcrest.MatcherAssert.*
Loaders::class.isProvidedBy(loaders),
WebOfTrustConnector::class.isProvidedBy(webOfTrustConnector),
ScheduledExecutorService::class.withNameIsProvidedBy(ticker, "notification"),
+ SoneTextParser::class.isProvidedByMock(),
NotificationHandlerModule()
)
verify(ticker).schedule(ArgumentMatchers.eq(webOfTrustPinger), ArgumentMatchers.eq(15L), ArgumentMatchers.eq(SECONDS))
}
+ @Test
+ fun `sone mention detector is created as singleton`() {
+ assertThat(injector.getInstance<SoneMentionDetector>(), notNullValue())
+ }
+
}