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,16 +115,15 @@ 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);
} if (mockClass != null) {
String mockClass = lookForMockWithAnnotationAsTestClass(cn); return mockClass;
if (mockClass != null) { }
return mockClass; mockClass = lookForInnerMockClass(cn);
} if (mockClass != null) {
mockClass = lookForInnerMockClass(cn); return mockClass;
if (mockClass != null) { }
return mockClass;
} }
return lookForOuterMockClass(className); return lookForOuterMockClass(className);
} }