X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Ftest%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fcore%2FSoneParserTest.kt;h=336d8555d9526568be3fce528433ecd2423f63eb;hb=a01e3b29a9dab0f8db0fbbdf718747229300781b;hp=0648d1f10dd0a0e4781a7af0ec202d62ec1f2b62;hpb=b55dc075f9cd34fb32baa44bbbc54a89d05e80b9;p=Sone.git diff --git a/src/test/kotlin/net/pterodactylus/sone/core/SoneParserTest.kt b/src/test/kotlin/net/pterodactylus/sone/core/SoneParserTest.kt index 0648d1f..336d855 100644 --- a/src/test/kotlin/net/pterodactylus/sone/core/SoneParserTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/core/SoneParserTest.kt @@ -398,10 +398,18 @@ class SoneParserTest { } @Test + fun `unsuccessful parsing does not add a histogram entry`() { + val inputStream = javaClass.getResourceAsStream("sone-parser-with-invalid-image-height.xml") + assertThat(soneParser.parseSone(sone, inputStream), nullValue()) + val histogram = metricRegistry.histogram("sone.parse.duration") + assertThat(histogram.count, equalTo(0L)) + } + + @Test fun `successful parsing adds histogram entry`() { val inputStream = javaClass.getResourceAsStream("sone-parser-without-images.xml") assertThat(soneParser.parseSone(sone, inputStream), notNullValue()) - val histogram = metricRegistry.histogram("sone.parsing.duration") + val histogram = metricRegistry.histogram("sone.parse.duration") assertThat(histogram.count, equalTo(1L)) }