@@ -90,11 +90,11 @@ void closeContextAfterTest() {
90
90
}
91
91
92
92
@ ParameterizedTest
93
- @ CsvSource ({
94
- " FixedDelay, 5000" ,
95
- " FixedDelayInSeconds, 5000" ,
96
- " FixedDelayInMinutes, 180000"
97
- } )
93
+ @ CsvSource (textBlock = """
94
+ FixedDelay, 5_000
95
+ FixedDelayInSeconds, 5_000
96
+ FixedDelayInMinutes, 180_000
97
+ """ )
98
98
void fixedDelayTask (@ NameToClass Class <?> beanClass , long expectedInterval ) {
99
99
BeanDefinition processorDefinition = new RootBeanDefinition (ScheduledAnnotationBeanPostProcessor .class );
100
100
BeanDefinition targetDefinition = new RootBeanDefinition (beanClass );
@@ -123,11 +123,11 @@ void fixedDelayTask(@NameToClass Class<?> beanClass, long expectedInterval) {
123
123
}
124
124
125
125
@ ParameterizedTest
126
- @ CsvSource ({
127
- " FixedRate, 3000" ,
128
- " FixedRateInSeconds, 5000" ,
129
- " FixedRateInMinutes, 180000"
130
- } )
126
+ @ CsvSource (textBlock = """
127
+ FixedRate, 3_000
128
+ FixedRateInSeconds, 5_000
129
+ FixedRateInMinutes, 180_000
130
+ """ )
131
131
void fixedRateTask (@ NameToClass Class <?> beanClass , long expectedInterval ) {
132
132
BeanDefinition processorDefinition = new RootBeanDefinition (ScheduledAnnotationBeanPostProcessor .class );
133
133
BeanDefinition targetDefinition = new RootBeanDefinition (beanClass );
@@ -158,11 +158,11 @@ void fixedRateTask(@NameToClass Class<?> beanClass, long expectedInterval) {
158
158
}
159
159
160
160
@ ParameterizedTest
161
- @ CsvSource ({
162
- " FixedRateWithInitialDelay, 1000, 3000" ,
163
- " FixedRateWithInitialDelayInSeconds, 5000, 3000" ,
164
- " FixedRateWithInitialDelayInMinutes, 60000, 180000"
165
- } )
161
+ @ CsvSource (textBlock = """
162
+ FixedRateWithInitialDelay, 1_000, 3_000
163
+ FixedRateWithInitialDelayInSeconds, 5_000, 3_000
164
+ FixedRateWithInitialDelayInMinutes, 60_000, 180_000
165
+ """ )
166
166
void fixedRateTaskWithInitialDelay (@ NameToClass Class <?> beanClass , long expectedInitialDelay , long expectedInterval ) {
167
167
BeanDefinition processorDefinition = new RootBeanDefinition (ScheduledAnnotationBeanPostProcessor .class );
168
168
BeanDefinition targetDefinition = new RootBeanDefinition (beanClass );
@@ -252,15 +252,15 @@ private void severalFixedRates(StaticApplicationContext context,
252
252
assertThat (targetObject ).isEqualTo (target );
253
253
assertThat (targetMethod .getName ()).isEqualTo ("fixedRate" );
254
254
assertThat (task1 .getInitialDelay ()).isEqualTo (0 );
255
- assertThat (task1 .getInterval ()).isEqualTo (4000L );
255
+ assertThat (task1 .getInterval ()).isEqualTo (4_000L );
256
256
IntervalTask task2 = fixedRateTasks .get (1 );
257
257
ScheduledMethodRunnable runnable2 = (ScheduledMethodRunnable ) task2 .getRunnable ();
258
258
targetObject = runnable2 .getTarget ();
259
259
targetMethod = runnable2 .getMethod ();
260
260
assertThat (targetObject ).isEqualTo (target );
261
261
assertThat (targetMethod .getName ()).isEqualTo ("fixedRate" );
262
- assertThat (task2 .getInitialDelay ()).isEqualTo (2000L );
263
- assertThat (task2 .getInterval ()).isEqualTo (4000L );
262
+ assertThat (task2 .getInitialDelay ()).isEqualTo (2_000L );
263
+ assertThat (task2 .getInterval ()).isEqualTo (4_000L );
264
264
}
265
265
266
266
@ Test
@@ -407,7 +407,7 @@ void metaAnnotationWithFixedRate() {
407
407
Method targetMethod = runnable .getMethod ();
408
408
assertThat (targetObject ).isEqualTo (target );
409
409
assertThat (targetMethod .getName ()).isEqualTo ("checkForUpdates" );
410
- assertThat (task .getInterval ()).isEqualTo (5000L );
410
+ assertThat (task .getInterval ()).isEqualTo (5_000L );
411
411
}
412
412
413
413
@ Test
@@ -434,8 +434,8 @@ void composedAnnotationWithInitialDelayAndFixedRate() {
434
434
Method targetMethod = runnable .getMethod ();
435
435
assertThat (targetObject ).isEqualTo (target );
436
436
assertThat (targetMethod .getName ()).isEqualTo ("checkForUpdates" );
437
- assertThat (task .getInterval ()).isEqualTo (5000L );
438
- assertThat (task .getInitialDelay ()).isEqualTo (1000L );
437
+ assertThat (task .getInterval ()).isEqualTo (5_000L );
438
+ assertThat (task .getInitialDelay ()).isEqualTo (1_000L );
439
439
}
440
440
441
441
@ Test
@@ -517,12 +517,12 @@ void propertyPlaceholderWithInactiveCron() {
517
517
}
518
518
519
519
@ ParameterizedTest
520
- @ CsvSource ({
521
- " PropertyPlaceholderWithFixedDelay, 5000, 1000, 5000, 1000" ,
522
- " PropertyPlaceholderWithFixedDelay, PT5S, PT1S, 5000, 1000" ,
523
- " PropertyPlaceholderWithFixedDelayInSeconds, 5000, 1000, 5000000, 1000000" ,
524
- " PropertyPlaceholderWithFixedDelayInSeconds, PT5S, PT1S, 5000, 1000"
525
- } )
520
+ @ CsvSource (textBlock = """
521
+ PropertyPlaceholderWithFixedDelay, 5000, 1000, 5_000, 1_000
522
+ PropertyPlaceholderWithFixedDelay, PT5S, PT1S, 5_000, 1_000
523
+ PropertyPlaceholderWithFixedDelayInSeconds, 5000, 1000, 5_000_000, 1_000_000
524
+ PropertyPlaceholderWithFixedDelayInSeconds, PT5S, PT1S, 5_000, 1_000
525
+ """ )
526
526
void propertyPlaceholderWithFixedDelay (@ NameToClass Class <?> beanClass , String fixedDelay , String initialDelay ,
527
527
long expectedInterval , long expectedInitialDelay ) {
528
528
@@ -561,12 +561,12 @@ void propertyPlaceholderWithFixedDelay(@NameToClass Class<?> beanClass, String f
561
561
}
562
562
563
563
@ ParameterizedTest
564
- @ CsvSource ({
565
- " PropertyPlaceholderWithFixedRate, 3000, 1000, 3000, 1000" ,
566
- " PropertyPlaceholderWithFixedRate, PT3S, PT1S, 3000, 1000" ,
567
- " PropertyPlaceholderWithFixedRateInSeconds, 3000, 1000, 3000000, 1000000" ,
568
- " PropertyPlaceholderWithFixedRateInSeconds, PT3S, PT1S, 3000, 1000"
569
- } )
564
+ @ CsvSource (textBlock = """
565
+ PropertyPlaceholderWithFixedRate, 3000, 1000, 3_000, 1_000
566
+ PropertyPlaceholderWithFixedRate, PT3S, PT1S, 3_000, 1_000
567
+ PropertyPlaceholderWithFixedRateInSeconds, 3000, 1000, 3_000_000, 1_000_000
568
+ PropertyPlaceholderWithFixedRateInSeconds, PT3S, PT1S, 3_000, 1_000
569
+ """ )
570
570
void propertyPlaceholderWithFixedRate (@ NameToClass Class <?> beanClass , String fixedRate , String initialDelay ,
571
571
long expectedInterval , long expectedInitialDelay ) {
572
572
@@ -728,7 +728,7 @@ void nonEmptyParamList() {
728
728
729
729
static class FixedDelay {
730
730
731
- @ Scheduled (fixedDelay = 5000 )
731
+ @ Scheduled (fixedDelay = 5_000 )
732
732
void fixedDelay () {
733
733
}
734
734
}
@@ -750,7 +750,7 @@ void fixedDelay() {
750
750
751
751
static class FixedRate {
752
752
753
- @ Scheduled (fixedRate = 3000 )
753
+ @ Scheduled (fixedRate = 3_000 )
754
754
void fixedRate () {
755
755
}
756
756
}
@@ -772,7 +772,7 @@ void fixedRate() {
772
772
773
773
static class FixedRateWithInitialDelay {
774
774
775
- @ Scheduled (fixedRate = 3000 , initialDelay = 1000 )
775
+ @ Scheduled (fixedRate = 3_000 , initialDelay = 1_000 )
776
776
void fixedRate () {
777
777
}
778
778
}
@@ -794,16 +794,16 @@ void fixedRate() {
794
794
795
795
static class SeveralFixedRatesWithSchedulesContainerAnnotationTestBean {
796
796
797
- @ Schedules ({@ Scheduled (fixedRate = 4000 ), @ Scheduled (fixedRate = 4000 , initialDelay = 2000 )})
797
+ @ Schedules ({@ Scheduled (fixedRate = 4_000 ), @ Scheduled (fixedRate = 4_000 , initialDelay = 2_000 )})
798
798
void fixedRate () {
799
799
}
800
800
}
801
801
802
802
803
803
static class SeveralFixedRatesWithRepeatedScheduledAnnotationTestBean {
804
804
805
- @ Scheduled (fixedRate = 4000 )
806
- @ Scheduled (fixedRate = 4000 , initialDelay = 2000 )
805
+ @ Scheduled (fixedRate = 4_000 )
806
+ @ Scheduled (fixedRate = 4_000 , initialDelay = 2_000 )
807
807
void fixedRate () {
808
808
}
809
809
@@ -819,8 +819,8 @@ static SeveralFixedRatesWithRepeatedScheduledAnnotationTestBean nestedProxy() {
819
819
820
820
static class FixedRatesBaseBean {
821
821
822
- @ Scheduled (fixedRate = 4000 )
823
- @ Scheduled (fixedRate = 4000 , initialDelay = 2000 )
822
+ @ Scheduled (fixedRate = 4_000 )
823
+ @ Scheduled (fixedRate = 4_000 , initialDelay = 2_000 )
824
824
void fixedRate () {
825
825
}
826
826
}
@@ -832,8 +832,8 @@ static class FixedRatesSubBean extends FixedRatesBaseBean {
832
832
833
833
interface FixedRatesDefaultMethod {
834
834
835
- @ Scheduled (fixedRate = 4000 )
836
- @ Scheduled (fixedRate = 4000 , initialDelay = 2000 )
835
+ @ Scheduled (fixedRate = 4_000 )
836
+ @ Scheduled (fixedRate = 4_000 , initialDelay = 2_000 )
837
837
default void fixedRate () {
838
838
}
839
839
}
@@ -916,13 +916,13 @@ void invalid() {
916
916
917
917
static class NonEmptyParamListTestBean {
918
918
919
- @ Scheduled (fixedRate = 3000 )
919
+ @ Scheduled (fixedRate = 3_000 )
920
920
void invalid (String oops ) {
921
921
}
922
922
}
923
923
924
924
925
- @ Scheduled (fixedRate = 5000 )
925
+ @ Scheduled (fixedRate = 5_000 )
926
926
@ Target (ElementType .METHOD )
927
927
@ Retention (RetentionPolicy .RUNTIME )
928
928
private @interface EveryFiveSeconds {
@@ -934,7 +934,7 @@ void invalid(String oops) {
934
934
private @interface Hourly {
935
935
}
936
936
937
- @ Scheduled (initialDelay = 1000 )
937
+ @ Scheduled (initialDelay = 1_000 )
938
938
@ Retention (RetentionPolicy .RUNTIME )
939
939
private @interface WaitASec {
940
940
@@ -956,7 +956,7 @@ void checkForUpdates() {
956
956
957
957
static class ComposedAnnotationFixedRateTestBean {
958
958
959
- @ WaitASec (fixedRate = 5000 )
959
+ @ WaitASec (fixedRate = 5_000 )
960
960
void checkForUpdates () {
961
961
}
962
962
}
0 commit comments