always look for outer mock class

This commit is contained in:
金戟 2021-02-19 17:16:01 +08:00
parent 82d87f3447
commit f660ccb88f

View File

@ -115,9 +115,7 @@ public class TestableClassTransformer implements ClassFileTransformer {
private String foundMockForTestClass(String className) { private String foundMockForTestClass(String className) {
ClassNode cn = ClassUtil.getClassNode(className); ClassNode cn = ClassUtil.getClassNode(className);
if (cn == null) { if (cn != null) {
return null;
}
String mockClass = lookForMockWithAnnotationAsTestClass(cn); String mockClass = lookForMockWithAnnotationAsTestClass(cn);
if (mockClass != null) { if (mockClass != null) {
return mockClass; return mockClass;
@ -126,6 +124,7 @@ public class TestableClassTransformer implements ClassFileTransformer {
if (mockClass != null) { if (mockClass != null) {
return mockClass; return mockClass;
} }
}
return lookForOuterMockClass(className); return lookForOuterMockClass(className);
} }