Spring Boot Integration Tests with Redis Testcontainer #247
wojciechcwek
started this conversation in
General
Replies: 1 comment
-
We can stop the rqueue auto startup by setting If this also does not work, you can try to disable the rqueue completely in test environment using properties
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I use Redis in Testcontainers in my tests. After adding rqueue spring boot to my project, all my integration tests (where the context of app goes up) are failing, because rqueueConfing connects to Redis on initializaiton (I'm not sure why but it adds metadata to Redis like db version, config etc.).
I get this exc:
Failed to instantiate [com.github.sonus21.rqueue.config.RqueueConfig]: Factory method 'rqueueConfig' threw exception with message: Unable to connect to Redis
What's more - integration tests that connect to Redis instance of Testcontainers used to past (before adding rqueue), now they fail, even though I start Testcontainer. This is because RqueueConfig bean initializes before Testcontainer Redis instance goes up.
Testcontainers start and stop every time they are needed (per test or per test class). They don't start at the begining of all tests and are shutdown at the end. They are not reused.
Is there a way to integrate rqueue with testcontainer and at the same time I wouldn't have to reorganize my all integration tests?
A quite similar topic was discussed here: #131 but I didn't find any answer in repo.
Thanks,
Wojtek
Beta Was this translation helpful? Give feedback.
All reactions