#Spring Boot Integration Test fails on mvn clean verify/test but passes in IDE

14 messages · Page 1 of 1 (latest)

plush stratusBOT
#

This post has been reserved for your question.

Hey @fresh heath! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

wanton dock
#

or is that all

fresh heath
#

yeah thats all of the stack trace

shadow moon
#

e.g. mvn verify -Dtest=MaterialServiceIntegrationTest

coarse shadow
# fresh heath

the test fails in maven because @ContextConfiguration interferes with spring boot’s normal test setup
so the fake s3 bean isn’t applied correctly when maven starts the application context from scratch

the fix is to remove @ContextConfiguration and replace the s3 dependency using @MockBean or a @TestConfiguration with @Import

plush stratusBOT
#

💤 Post marked as dormant

This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping.
Warning: abusing this will result in moderative actions taken against you.

plush stratusBOT
#

💤 Post marked as dormant

This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping.
Warning: abusing this will result in moderative actions taken against you.

fresh heath
plush stratusBOT
# fresh heath yeah @MockitoBean works. thanks

If you are finished with your post, please close it.
If you are not, please ignore this message.
Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.

plush stratusBOT
#

💤 Post marked as dormant

This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping.
Warning: abusing this will result in moderative actions taken against you.