From 8e0b3bc06f90288764833ad553c9a92bdd5ded15 Mon Sep 17 00:00:00 2001 From: Thomas Butz Date: Fri, 13 Dec 2024 10:30:23 +0100 Subject: [PATCH] Avoid throws declaration --- .../java/no/ecc/vectortile/VectorTileDecoderTest.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/web-bundle/src/test/java/no/ecc/vectortile/VectorTileDecoderTest.java b/web-bundle/src/test/java/no/ecc/vectortile/VectorTileDecoderTest.java index 2da3924edb..aa4512ffbc 100644 --- a/web-bundle/src/test/java/no/ecc/vectortile/VectorTileDecoderTest.java +++ b/web-bundle/src/test/java/no/ecc/vectortile/VectorTileDecoderTest.java @@ -1,7 +1,6 @@ package no.ecc.vectortile; import org.junit.jupiter.api.Test; -import vector_tile.VectorTile; import java.io.IOException; import java.io.InputStream; @@ -11,16 +10,19 @@ public class VectorTileDecoderTest { @Test - public void testDecode() throws IOException { + public void testDecode() { byte[] data; try (InputStream is = getClass().getResourceAsStream("small.vector.pbf")) { if (is == null) { fail("Could not find test data"); } data = is.readAllBytes(); + } catch (IOException e) { + fail("Could not read test data", e); + return; } - VectorTileDecoder decoder = new VectorTileDecoder(); - VectorTileDecoder.FeatureIterable iter = decoder.decode(data); + var decoder = new VectorTileDecoder(); + var iter = assertDoesNotThrow(() -> decoder.decode(data), "Decoding failed"); assertEquals(20, iter.getLayerNames().size()); assertEquals(2759, iter.asList().size());