}
@Provides
+ @Singleton
fun getCore(configuration: Configuration, freenetInterface: FreenetInterface, identityManager: IdentityManager, soneDownloader: SoneDownloader, imageInserter: ImageInserter, updateChecker: UpdateChecker, webOfTrustUpdater: WebOfTrustUpdater, eventBus: EventBus, database: Database) =
Core(configuration, freenetInterface, identityManager, soneDownloader, imageInserter, updateChecker, webOfTrustUpdater, eventBus, database).apply {
debugInformation.showVersionInformation = configuration.getBooleanValue("Debug/ShowVersionInformation").getValue(false)
assertThat(testObject.ref.get(), sameInstance(event))
}
+ @Test
+ fun `core is created as singleton`() {
+ val firstCore = injector.getInstance<Core>()
+ val secondCore = injector.getInstance<Core>()
+ assertThat(secondCore, sameInstance(firstCore))
+ }
+
}