Skip to content

Commit 8b8604d

Browse files
committed
Align after merge from 6.1.x
1 parent 4bb755e commit 8b8604d

File tree

2 files changed

+27
-25
lines changed

2 files changed

+27
-25
lines changed

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

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import java.time.Duration;
2121
import java.util.ArrayList;
2222
import java.util.Collection;
23+
import java.util.Collections;
2324
import java.util.IdentityHashMap;
2425
import java.util.LinkedHashSet;
2526
import java.util.List;

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

+26-25
Original file line numberDiff line numberDiff line change
@@ -679,6 +679,32 @@ void nonEmptyParamList() {
679679
}
680680

681681

682+
static ScheduledMethodRunnableAssert assertThatScheduledRunnable(Runnable runnable) {
683+
return new ScheduledMethodRunnableAssert(runnable);
684+
}
685+
686+
687+
static class ScheduledMethodRunnableAssert extends AbstractAssert<ScheduledMethodRunnableAssert, Runnable> {
688+
689+
public ScheduledMethodRunnableAssert(Runnable actual) {
690+
super(actual, ScheduledMethodRunnableAssert.class);
691+
assertThat(actual).extracting("runnable").isInstanceOf(ScheduledMethodRunnable.class);
692+
}
693+
694+
public ScheduledMethodRunnableAssert hasTarget(Object target) {
695+
isNotNull();
696+
assertThat(actual).extracting("runnable.target").isEqualTo(target);
697+
return this;
698+
}
699+
700+
public ScheduledMethodRunnableAssert hasMethodName(String name) {
701+
isNotNull();
702+
assertThat(actual).extracting("runnable.method.name").isEqualTo(name);
703+
return this;
704+
}
705+
}
706+
707+
682708
static class FixedDelay {
683709

684710
@Scheduled(fixedDelay = 5_000)
@@ -1019,29 +1045,4 @@ public Class<?> convert(Object beanClassName, ParameterContext context) throws A
10191045
}
10201046
}
10211047

1022-
static ScheduledMethodRunnableAssert assertThatScheduledRunnable(Runnable runnable) {
1023-
return new ScheduledMethodRunnableAssert(runnable);
1024-
}
1025-
1026-
static class ScheduledMethodRunnableAssert extends AbstractAssert<ScheduledMethodRunnableAssert, Runnable> {
1027-
1028-
public ScheduledMethodRunnableAssert(Runnable actual) {
1029-
super(actual, ScheduledMethodRunnableAssert.class);
1030-
assertThat(actual).extracting("runnable").isInstanceOf(ScheduledMethodRunnable.class);
1031-
}
1032-
1033-
public ScheduledMethodRunnableAssert hasTarget(Object target) {
1034-
isNotNull();
1035-
assertThat(actual).extracting("runnable.target").isEqualTo(target);
1036-
return this;
1037-
}
1038-
1039-
public ScheduledMethodRunnableAssert hasMethodName(String name) {
1040-
isNotNull();
1041-
assertThat(actual).extracting("runnable.method.name").isEqualTo(name);
1042-
return this;
1043-
}
1044-
1045-
}
1046-
10471048
}

0 commit comments

Comments
 (0)