File tree Expand file tree Collapse file tree 4 files changed +11
-3
lines changed
main/java/org/springframework/boot/test/mock/mockito
test/java/org/springframework/boot/test/mock/mockito Expand file tree Collapse file tree 4 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -91,7 +91,7 @@ private static class Verification {
9191
9292private final MockingProgress progress ;
9393
94- public Verification (Object target ) {
94+ Verification (Object target ) {
9595this .progress = MockitoApi .get ().mockingProgress (target );
9696}
9797
Original file line number Diff line number Diff line change @@ -164,9 +164,9 @@ private static class Mockito2Api extends MockitoApi {
164164
165165private final Method getMatcherMethod ;
166166
167- private Constructor <MockAwareVerificationMode > mockAwareVerificationModeConstructor ;
167+ private final Constructor <MockAwareVerificationMode > mockAwareVerificationModeConstructor ;
168168
169- public Mockito2Api () {
169+ Mockito2Api () {
170170this .getMockSettingsMethod = ReflectionUtils .findMethod (MockUtil .class ,
171171"getMockSettings" , Object .class );
172172this .mockingProgressMethod = ReflectionUtils
Original file line number Diff line number Diff line change 2020import org .junit .runner .JUnitCore ;
2121import org .junit .runner .Result ;
2222import org .junit .runner .RunWith ;
23+ import org .junit .runner .notification .Failure ;
2324
2425import org .springframework .boot .junit .runner .classpath .ClassPathOverrides ;
2526import org .springframework .boot .junit .runner .classpath .ModifiedClassPathRunner ;
@@ -47,6 +48,9 @@ public void spyBeanWithAopProxyTestsWithMockito2() {
4748
4849private void runTests (Class <?> testClass ) {
4950Result result = new JUnitCore ().run (testClass );
51+ for (Failure failure : result .getFailures ()) {
52+ System .err .println (failure .getTrace ());
53+ }
5054assertThat (result .getFailureCount ()).isEqualTo (0 );
5155assertThat (result .getRunCount ()).isGreaterThan (0 );
5256}
Original file line number Diff line number Diff line change 2020import org .junit .runner .JUnitCore ;
2121import org .junit .runner .Result ;
2222import org .junit .runner .RunWith ;
23+ import org .junit .runner .notification .Failure ;
2324
2425import org .springframework .boot .junit .runner .classpath .ClassPathOverrides ;
2526import org .springframework .boot .junit .runner .classpath .ModifiedClassPathRunner ;
@@ -47,6 +48,9 @@ public void spyBeanWithAopProxyTestsWithMockito2() {
4748
4849private void runTests (Class <?> testClass ) {
4950Result result = new JUnitCore ().run (testClass );
51+ for (Failure failure : result .getFailures ()) {
52+ System .err .println (failure .getTrace ());
53+ }
5054assertThat (result .getFailureCount ()).isEqualTo (0 );
5155assertThat (result .getRunCount ()).isGreaterThan (0 );
5256}
You can’t perform that action at this time.
0 commit comments