From 14549040d9f0f74081126e154e7ab70aa9790258 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=87=91=E6=88=9F?= Date: Wed, 17 Feb 2021 23:24:14 +0800 Subject: [PATCH] fit invoke from test case without testable --- .../com/alibaba/testable/core/util/MockAssociationUtil.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/testable-core/src/main/java/com/alibaba/testable/core/util/MockAssociationUtil.java b/testable-core/src/main/java/com/alibaba/testable/core/util/MockAssociationUtil.java index 1bcc9fd..5e07197 100644 --- a/testable-core/src/main/java/com/alibaba/testable/core/util/MockAssociationUtil.java +++ b/testable-core/src/main/java/com/alibaba/testable/core/util/MockAssociationUtil.java @@ -29,9 +29,8 @@ public class MockAssociationUtil { public static boolean isAssociated() { MockContext mockContext = MockContextUtil.context.get(); if (mockContext == null) { - // skip the association check - LogUtil.warn("Mock association check is invoked without test context"); - return true; + // invoked from test case not transformed by testable + return false; } String testClassName = mockContext.testClassName; String mockClassName = Thread.currentThread().getStackTrace()[INDEX_OF_MOCK_CLASS].getClassName();