Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration test example for retry in springboot? #13

Open
Schachte opened this issue Jul 15, 2021 · 0 comments
Open

Integration test example for retry in springboot? #13

Schachte opened this issue Jul 15, 2021 · 0 comments

Comments

@Schachte
Copy link

Relevant:
https://stackoverflow.com/questions/68400270/unable-to-get-resilience4j-retry-annotation-to-execute-in-springboot-unit-test

Curious on how I can test the retry annotation, it seems like the fallback is never getting called and retry isn't being invoked when a failure is hit.

I'm bubbling up exceptions in a catch all and it works when I run the code, just not the test:

resilience4j.retry.instances.transformer.maxAttempts=3
resilience4j.retry.instances.transformer.waitDuration=1s
resilience4j.retry.instances.transformer.enableExponentialBackoff=false
resilience4j.retry.instances.transformer.exponentialBackoffMultiplier=1
resilience4j.retry.instances.transformer.retryExceptions[0]=com.thing.MyException

When I debug the test, it hits the code and exception that the @Retry annotation is on, but it just fails with an exception instead of retrying.

I'm using SpringBootTest annotation to get everything autowired. More code provided in the above link.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant