Skip to content

Commit 3c11661

Browse files
committed
fix checkpoint test and checkstyle polish
1 parent f5b03c5 commit 3c11661

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

spring-context/src/main/java/org/springframework/scheduling/annotation/ScheduledAnnotationReactiveSupport.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ static class ReactiveTask {
5757
private final Duration initialDelay;
5858
private final Duration otherDelay;
5959
private final boolean isFixedRate;
60-
private final String checkpoint;
60+
protected final String checkpoint;
6161
private final Disposable.Swap disposable;
6262

6363
private final Log logger = LogFactory.getLog(getClass());

spring-context/src/test/java/org/springframework/scheduling/annotation/ScheduledAnnotationReactiveSupportTests.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import java.util.concurrent.CompletableFuture;
2222
import java.util.concurrent.atomic.AtomicInteger;
2323

24-
import org.awaitility.Awaitility;
2524
import org.junit.jupiter.api.BeforeEach;
2625
import org.junit.jupiter.api.Nested;
2726
import org.junit.jupiter.api.Test;
@@ -238,11 +237,10 @@ void monoErrorHasCheckpoint() throws InterruptedException {
238237
final ScheduledAnnotationReactiveSupport.ReactiveTask reactiveTask = new ScheduledAnnotationReactiveSupport.ReactiveTask(
239238
m, target, Duration.ZERO, Duration.ofSeconds(10), true);
240239

241-
reactiveTask.subscribe();
242-
Thread.sleep(500);
243-
244-
reactiveTask.cancel();
240+
assertThat(reactiveTask.checkpoint).isEqualTo("@Scheduled 'org.springframework.scheduling.annotation"
241+
+ ".ScheduledAnnotationReactiveSupportTests$ReactiveMethods#monoError()'"
242+
+ " [ScheduledAnnotationReactiveSupport]");
245243
}
246244

247245
}
248-
}
246+
}

0 commit comments

Comments
 (0)