Skip to content

Commit 2ba825a

Browse files
committed
Fix shouldWrapInRuntimeExWhenUsingUnchecked test relying on internal implementation details
1 parent ad95ee9 commit 2ba825a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/test/java/com/pivovarit/function/ThrowingIntFunctionTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
class ThrowingIntFunctionTest {
1818

1919
private static final String EXPECTED_MESSAGE = "Oh no! " + UUID.randomUUID();
20+
2021
private static final ThrowingIntFunction<String, Exception> THROWS_CHECKED = i -> {
2122
throw new Exception(EXPECTED_MESSAGE);
2223
};
@@ -54,7 +55,7 @@ void shouldWrapInRuntimeEx() {
5455

5556
@Test
5657
void shouldWrapInRuntimeExWhenUsingUnchecked() {
57-
assertThatThrownBy(() -> IntStream.of(1).mapToObj(unchecked(THROWS_CHECKED)).count())
58+
assertThatThrownBy(() -> IntStream.of(1).mapToObj(unchecked(THROWS_CHECKED)).toArray())
5859
.isInstanceOf(WrappedException.class)
5960
.hasMessage(EXPECTED_MESSAGE)
6061
.hasCauseInstanceOf(Exception.class);
@@ -76,4 +77,4 @@ void shouldWrapInOptionalWhenUsingStandardUtilsFunctions() {
7677
assertThat(result).isZero();
7778
}
7879

79-
}
80+
}

0 commit comments

Comments
 (0)