Verifying retries with @Retryable
About
Example
Actual Source Code
@SpringBootApplication
@EnableRetry
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}@Service
public class PaymentService {
@Retryable(value = SomeRetryableException.class, maxAttempts = 3)
public void abc() {
throw new SomeRetryableException("Simulated failure");
}
}Test Class
Last updated