@MockitoBean
does not get reset in inherited @Nested
tests
#34906
Labels
in: test
Issues in the test module
status: waiting-for-triage
An issue we've not yet triaged or decided on
Uh oh!
There was an error while loading. Please reload this page.
In the snippet below, the
ServiceB
MockBean
is not reset betweenfirstTest
andsecondTest
, but it should be. This causessecondTest
to fail onverify(serviceB).bar();
, as there are 2 invocations instead of just the expected 1.Note that the
@Import(ServiceC.class)
onChildTest
is not required for the test as such, but causes (by some mysterious means) the failure to resetServiceB
, as removing the@Import
will make the test pass.Spring Boot version is 3.4.5.
This issue may be related to spring-projects/spring-boot#12470.
Services
Test
The text was updated successfully, but these errors were encountered: