diff --git a/src/test/java/no/digipost/DiggBaseTest.java b/src/test/java/no/digipost/DiggBaseTest.java index d56600e..f35cfd4 100644 --- a/src/test/java/no/digipost/DiggBaseTest.java +++ b/src/test/java/no/digipost/DiggBaseTest.java @@ -164,6 +164,8 @@ public void useArbitraryObjectWithTryWithResources(@Mock MyResource resource) { interface MyAutoCloseableResource extends AutoCloseable { void done() throws IOException; + @Override + void close() throws RuntimeException; } @Test diff --git a/src/test/java/no/digipost/DiggEnumsTest.java b/src/test/java/no/digipost/DiggEnumsTest.java index 91e7492..7f395e5 100644 --- a/src/test/java/no/digipost/DiggEnumsTest.java +++ b/src/test/java/no/digipost/DiggEnumsTest.java @@ -54,7 +54,7 @@ public void convertFromCommaSeparatedListOfEnumNames() { qt() .forAll(multipleEnums) - .asWithPrecursor(enums -> Stream.of(enums).map(Enum::name).collect(joining(" , ", " ", " "))) + .asWithPrecursor(enums -> Stream.of(enums).map(MyEnum::name).collect(joining(" , ", " ", " "))) .checkAssert((enums, commaSeparatedNames) -> assertThat(fromCommaSeparatedNames(commaSeparatedNames, MyEnum.class), contains(enums))); } @@ -74,11 +74,11 @@ public void convertToStringOfDelimiterSeparatedStrings() { public void toStringConversionsAreSpecialCasesOfTheGenericBaseCase() { qt() .forAll(multipleEnums) - .check(enums -> toCommaSeparatedNames(enums).equals(toStringOf(Enum::name, joining(","), enums))); + .check(enums -> toCommaSeparatedNames(enums).equals(toStringOf(MyEnum::name, joining(","), enums))); qt() .forAll(multipleEnums) - .check(enums -> toNames(": ", enums).equals(toStringOf(Enum::name, joining(": "), enums))); + .check(enums -> toNames(": ", enums).equals(toStringOf(MyEnum::name, joining(": "), enums))); qt() .forAll(multipleEnums) diff --git a/src/test/java/no/digipost/collection/BatchedIterableTest.java b/src/test/java/no/digipost/collection/BatchedIterableTest.java index 7e5b46e..8bec45a 100644 --- a/src/test/java/no/digipost/collection/BatchedIterableTest.java +++ b/src/test/java/no/digipost/collection/BatchedIterableTest.java @@ -36,11 +36,13 @@ class BatchedIterableTest { @Test void emptyBatch() { - Batches empty1 = new Batches<>(); + @SuppressWarnings("unchecked") + Batches empty1 = new Batches<>(); assertThat(batched(empty1, b -> false), is(emptyIterable())); assertThat(empty1.fetches(), is(1)); - Batches empty2 = new Batches<>(); + @SuppressWarnings("unchecked") + Batches empty2 = new Batches<>(); assertThat(batched(empty2, b -> true), is(emptyIterable())); assertThat(empty2.fetches(), is(2)); } diff --git a/src/test/java/no/digipost/io/InputStreamIteratorTest.java b/src/test/java/no/digipost/io/InputStreamIteratorTest.java index 060520c..0524a29 100644 --- a/src/test/java/no/digipost/io/InputStreamIteratorTest.java +++ b/src/test/java/no/digipost/io/InputStreamIteratorTest.java @@ -71,7 +71,7 @@ void throws_if_next_is_called_with_no_more_elements() throws Exception { InputStreamIterator iterator = new InputStreamIterator(inputStream, 2); assertThat(consumeToString(iterator, UTF_8), is("Some data")); - assertThat(iterator, whereNot(Iterator::hasNext)); + assertThat(iterator, whereNot(Iterator::hasNext)); assertThrows(NoSuchElementException.class, iterator::next); }