diff --git a/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/MockitoAopProxyTargetInterceptor.java b/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/MockitoAopProxyTargetInterceptor.java index b60d08c5d8..3aef4ca191 100644 --- a/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/MockitoAopProxyTargetInterceptor.java +++ b/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/MockitoAopProxyTargetInterceptor.java @@ -91,7 +91,7 @@ class MockitoAopProxyTargetInterceptor implements MethodInterceptor { private final MockingProgress progress; - public Verification(Object target) { + Verification(Object target) { this.progress = MockitoApi.get().mockingProgress(target); } diff --git a/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/MockitoApi.java b/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/MockitoApi.java index b24ba40495..8e8f601ca3 100644 --- a/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/MockitoApi.java +++ b/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/MockitoApi.java @@ -164,9 +164,9 @@ abstract class MockitoApi { private final Method getMatcherMethod; - private Constructor mockAwareVerificationModeConstructor; + private final Constructor mockAwareVerificationModeConstructor; - public Mockito2Api() { + Mockito2Api() { this.getMockSettingsMethod = ReflectionUtils.findMethod(MockUtil.class, "getMockSettings", Object.class); this.mockingProgressMethod = ReflectionUtils diff --git a/spring-boot-test/src/test/java/org/springframework/boot/test/mock/mockito/Mockito21Tests.java b/spring-boot-test/src/test/java/org/springframework/boot/test/mock/mockito/Mockito21Tests.java index c6878dea47..63866ca35e 100644 --- a/spring-boot-test/src/test/java/org/springframework/boot/test/mock/mockito/Mockito21Tests.java +++ b/spring-boot-test/src/test/java/org/springframework/boot/test/mock/mockito/Mockito21Tests.java @@ -20,6 +20,7 @@ import org.junit.Test; import org.junit.runner.JUnitCore; import org.junit.runner.Result; import org.junit.runner.RunWith; +import org.junit.runner.notification.Failure; import org.springframework.boot.junit.runner.classpath.ClassPathOverrides; import org.springframework.boot.junit.runner.classpath.ModifiedClassPathRunner; @@ -47,6 +48,9 @@ public class Mockito21Tests { private void runTests(Class testClass) { Result result = new JUnitCore().run(testClass); + for (Failure failure : result.getFailures()) { + System.err.println(failure.getTrace()); + } assertThat(result.getFailureCount()).isEqualTo(0); assertThat(result.getRunCount()).isGreaterThan(0); } diff --git a/spring-boot-test/src/test/java/org/springframework/boot/test/mock/mockito/Mockito22Tests.java b/spring-boot-test/src/test/java/org/springframework/boot/test/mock/mockito/Mockito22Tests.java index 967f1b79ba..61fcfd7db2 100644 --- a/spring-boot-test/src/test/java/org/springframework/boot/test/mock/mockito/Mockito22Tests.java +++ b/spring-boot-test/src/test/java/org/springframework/boot/test/mock/mockito/Mockito22Tests.java @@ -20,6 +20,7 @@ import org.junit.Test; import org.junit.runner.JUnitCore; import org.junit.runner.Result; import org.junit.runner.RunWith; +import org.junit.runner.notification.Failure; import org.springframework.boot.junit.runner.classpath.ClassPathOverrides; import org.springframework.boot.junit.runner.classpath.ModifiedClassPathRunner; @@ -47,6 +48,9 @@ public class Mockito22Tests { private void runTests(Class testClass) { Result result = new JUnitCore().run(testClass); + for (Failure failure : result.getFailures()) { + System.err.println(failure.getTrace()); + } assertThat(result.getFailureCount()).isEqualTo(0); assertThat(result.getRunCount()).isGreaterThan(0); }