Skip to content

Commit b24496e

Browse files
Fix tests that didn't throw exceptions as expected
These tests contained a double nested lambda. Therefore withEnvironmentVariable's execute only executed a Statement that created a Callable instead of executing the Callable. Co-authored-by: Stefan Birkner <mail@stefan-birkner.de>
1 parent 416ca75 commit b24496e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/test/java/com/github/stefanbirkner/systemlambda/WithEnvironmentVariableTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ void after_callable_throws_exception() {
251251

252252
ignoreException(
253253
() -> withEnvironmentVariable("dummy name", randomValue())
254-
.execute(() -> (Callable<String>) () -> {
254+
.execute((Callable<String>) () -> {
255255
throw new RuntimeException("dummy exception");
256256
})
257257
);
@@ -306,7 +306,7 @@ void after_callable_throws_exception() {
306306

307307
ignoreException(
308308
() -> withEnvironmentVariable("dummy name", randomValue())
309-
.execute(() -> (Callable<String>) () -> {
309+
.execute((Callable<String>) () -> {
310310
throw new RuntimeException("dummy exception");
311311
})
312312
);

0 commit comments

Comments
 (0)