@MockitoBean behavior is not consistent with @MockBean when using @PostConstruct #34120
Labels
in: test
Issues in the test module
status: duplicate
A duplicate of another issue
type: regression
A bug that is also a regression
When switching from using
@MockBean
annotation to@MockitoBean
in one of our projects, I have found some inconsistency between the two, if@PostConstruct
annotation is being used along withMockReset.NONE
. Here is the minimal reproductive example.I suspect, that there was some change in the time when resetting the mocks happen - for some reason
@MockitoBean
is being reset after@PostConstruct
is resolved, even though theMockReset.NONE
is being used for its configuration - this is not a case for@MockBean
.The text was updated successfully, but these errors were encountered: