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)
+ debugInformation.showMetrics = configuration.getBooleanValue("Debug/ShowMetrics").getValue(false)
}.also(eventBus::register)
}
}
@Test
+ fun `show metrics debug information flag is read from config`() {
+ File(currentDir, "sone.properties").writeText("Debug/ShowMetrics=true")
+ assertThat(injector.getInstance<Core>().debugInformation.showMetrics, equalTo(true))
+ }
+
+ @Test
fun `event bus is bound`() {
assertThat(injector.getInstance<EventBus>(), notNullValue())
}