X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Ftest%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fcore%2FSoneInserterTest.kt;h=2f902509596fc153b818fac27581b28e538107eb;hb=faf66247a34f64946990a985d2ea3003465969cb;hp=d2bb3b49c95d1c1f5ce91dc2b9361a3e97ba2e37;hpb=aa83028a17a61b8a2103475fae4624fbfe4c9ca5;p=Sone.git diff --git a/src/test/kotlin/net/pterodactylus/sone/core/SoneInserterTest.kt b/src/test/kotlin/net/pterodactylus/sone/core/SoneInserterTest.kt index d2bb3b4..2f90250 100644 --- a/src/test/kotlin/net/pterodactylus/sone/core/SoneInserterTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/core/SoneInserterTest.kt @@ -104,7 +104,7 @@ class SoneInserterTest { doAnswer { soneInserter.stop() null - }.`when`(core).touchConfiguration() + }.whenever(core).touchConfiguration() soneInserter.serviceRun() val soneEvents = ArgumentCaptor.forClass(SoneEvent::class.java) verify(freenetInterface).insertDirectory(eq(insertUri), any>(), eq("index.html")) @@ -251,14 +251,14 @@ class SoneInserterTest { doAnswer { soneInserter.stop() null - }.`when`(core).touchConfiguration() + }.whenever(core).touchConfiguration() soneInserter.serviceRun() val histogram = metricRegistry.histogram("sone.insert.duration") assertThat(histogram.count, equalTo(1L)) } @Test - fun `unsuccessful insert does not update metrics`() { + fun `unsuccessful insert does not update histogram but records error`() { val insertUri = mock() createSone(insertUri) val soneModificationDetector = mock() @@ -271,6 +271,8 @@ class SoneInserterTest { soneInserter.serviceRun() val histogram = metricRegistry.histogram("sone.insert.duration") assertThat(histogram.count, equalTo(0L)) + val meter = metricRegistry.meter("sone.insert.errors") + assertThat(meter.count, equalTo(1L)) } }