Reinstate init of Mockito mocks in test execution listener
Closes gh-42708
This commit is contained in:
@@ -16,7 +16,6 @@
|
||||
|
||||
package org.springframework.boot.test.context.nestedtests;
|
||||
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.Nested;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
@@ -40,7 +39,6 @@ import static org.mockito.Mockito.times;
|
||||
*/
|
||||
@SpringBootTest(classes = AppConfiguration.class)
|
||||
@Import(ActionPerformer.class)
|
||||
@Disabled("https://github.com/spring-projects/spring-framework/issues/33676")
|
||||
class InheritedNestedTestConfigurationTests {
|
||||
|
||||
@MockitoBean
|
||||
|
||||
@@ -54,7 +54,6 @@ import static org.mockito.BDDMockito.given;
|
||||
@SuppressWarnings("removal")
|
||||
@Deprecated(since = "3.4.0", forRemoval = true)
|
||||
@ExtendWith(SpringExtension.class)
|
||||
@Disabled("https://github.com/spring-projects/spring-framework/issues/33690")
|
||||
class MockitoTestExecutionListenerIntegrationTests {
|
||||
|
||||
@Nested
|
||||
|
||||
@@ -56,6 +56,14 @@ class MockitoTestExecutionListenerTests {
|
||||
@Mock
|
||||
private MockitoPostProcessor postProcessor;
|
||||
|
||||
@Test
|
||||
void prepareTestInstanceShouldInitMockitoAnnotations() throws Exception {
|
||||
WithMockitoAnnotations instance = new WithMockitoAnnotations();
|
||||
this.listener.prepareTestInstance(mockTestContext(instance));
|
||||
assertThat(instance.mock).isNotNull();
|
||||
assertThat(instance.captor).isNotNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
void prepareTestInstanceShouldInjectMockBean() throws Exception {
|
||||
given(this.applicationContext.getBean(MockitoPostProcessor.class)).willReturn(this.postProcessor);
|
||||
|
||||
Reference in New Issue
Block a user