Skip to content

Commit

Permalink
Avoid throws declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
otbutz committed Dec 13, 2024
1 parent ca60866 commit 8e0b3bc
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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());
Expand Down

0 comments on commit 8e0b3bc

Please sign in to comment.