Skip to content

Commit 555b585

Browse files
committed
Fix new nullability issues
1 parent 0dec7a9 commit 555b585

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

jupiter-tests/src/test/java/org/junit/jupiter/api/FailAssertionsTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ void failUsableAsAnExpression() {
145145
long count = Stream.empty()
146146
.peek(element -> fail("peek should never be called"))
147147
.filter(element -> fail("filter should never be called", new Throwable("cause")))
148-
.map(element -> fail(new Throwable("map should never be called")))
148+
.map(element -> Assertions.<Throwable> fail(new Throwable("map should never be called")))
149149
.sorted((e1, e2) -> fail(() -> "sorted should never be called"))
150150
.count();
151151
// @formatter:on

jupiter-tests/src/test/java/org/junit/jupiter/engine/extension/PreInterruptCallbackTests.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
import java.util.function.UnaryOperator;
3737

3838
import org.assertj.core.api.Condition;
39+
import org.jspecify.annotations.Nullable;
3940
import org.junit.jupiter.api.AfterEach;
4041
import org.junit.jupiter.api.BeforeEach;
4142
import org.junit.jupiter.api.Test;
@@ -61,10 +62,10 @@ class PreInterruptCallbackTests extends AbstractJupiterTestEngineTests {
6162
private static final String TC = "test";
6263
private static final String TIMEOUT_ERROR_MSG = TC + "() timed out after 1 microsecond";
6364
private static final AtomicBoolean interruptedTest = new AtomicBoolean();
64-
private static final CompletableFuture<Void> testThreadExecutionDone = new CompletableFuture<>();
65-
private static final AtomicReference<Thread> interruptedTestThread = new AtomicReference<>();
65+
private static final CompletableFuture<?> testThreadExecutionDone = new CompletableFuture<>();
66+
private static final AtomicReference<@Nullable Thread> interruptedTestThread = new AtomicReference<>();
6667
private static final AtomicBoolean interruptCallbackShallThrowException = new AtomicBoolean();
67-
private static final AtomicReference<PreInterruptContext> calledPreInterruptContext = new AtomicReference<>();
68+
private static final AtomicReference<@Nullable PreInterruptContext> calledPreInterruptContext = new AtomicReference<>();
6869

6970
@BeforeEach
7071
void setUp() {

0 commit comments

Comments
 (0)