File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
spring-core/src/test/java/org/springframework/core/retry Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -114,6 +114,7 @@ void retryWithInitialFailureAndZeroRetriesRetryPolicy() {
114114verifyNoMoreInteractions (retryListener );
115115}
116116
117+
117118@ Test
118119void retryWithInitialFailureAndZeroRetriesFixedBackOffPolicy () {
119120RetryPolicy retryPolicy = RetryPolicy .withMaxRetries (0 );
@@ -202,11 +203,11 @@ public String getName() {
202203.withMessage ("Retry policy for operation 'test' exhausted; aborting execution" )
203204.withCause (new CustomException ("Boom 4" ))
204205.satisfies (throwable -> {
205- invocationCount . set (1 );
206+ var counter = new AtomicInteger (1 );
206207repeat (3 , () -> {
207208inOrder .verify (retryListener ).beforeRetry (retryPolicy , retryable );
208209inOrder .verify (retryListener ).onRetryFailure (retryPolicy , retryable ,
209- new CustomException ("Boom " + invocationCount .incrementAndGet ()));
210+ new CustomException ("Boom " + counter .incrementAndGet ()));
210211});
211212inOrder .verify (retryListener ).onRetryPolicyExhaustion (retryPolicy , retryable , throwable );
212213});
You can’t perform that action at this time.
0 commit comments