Skip to content

Mongo configs on Spring Application does not reflect in tests #430

Answered by diegoqueres
diegoqueres asked this question in Q&A
Discussion options

You must be logged in to vote

I found that if I use annotation: @SpringBootTest, instead of @DataMongoTest, the test class is able to load all spring context (including configuration classes, listeners, ...).
The @DataMongoTest annotation can be used when it's not integration testing and when you don't need to load extra configurations (like the ones I did).
By the way, i'm using spring 2.7.x

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by diegoqueres
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant