【发布时间】:2021-02-01 17:10:54
【问题描述】:
我有这个定义了常量的类
public class Constants {
public static final boolean TEST = true;
}
我想检查一下这个常量是否为 TRUE,如下所示:
@Test
@EnabledIf("'true' == Constants.TEST")
public void theMeasurementSampleScreenFromPickConfirm() throws InterruptedException {
// some code execution
}
但我收到错误java.lang.NoSuchMethodError: 'java.lang.reflect.Method org.junit.platform.commons.util.ReflectionUtils.getRequiredMethod(java.lang.Class, java.lang.String, java.lang.Class[])'
你知道我怎样才能正确地实施这项检查吗?
【问题讨论】: