fit invoke from test case without testable

This commit is contained in:
金戟 2021-02-17 23:24:14 +08:00
parent 03ec857cd0
commit 14549040d9

View File

@ -29,9 +29,8 @@ public class MockAssociationUtil {
public static boolean isAssociated() { public static boolean isAssociated() {
MockContext mockContext = MockContextUtil.context.get(); MockContext mockContext = MockContextUtil.context.get();
if (mockContext == null) { if (mockContext == null) {
// skip the association check // invoked from test case not transformed by testable
LogUtil.warn("Mock association check is invoked without test context"); return false;
return true;
} }
String testClassName = mockContext.testClassName; String testClassName = mockContext.testClassName;
String mockClassName = Thread.currentThread().getStackTrace()[INDEX_OF_MOCK_CLASS].getClassName(); String mockClassName = Thread.currentThread().getStackTrace()[INDEX_OF_MOCK_CLASS].getClassName();