Unit testing 未找到与方法匹配的测试-单元测试PowerMockito
我使用@Preparefortest内部类Unit testing 未找到与方法匹配的测试-单元测试PowerMockito,unit-testing,spring-mvc,powermockito,Unit Testing,Spring Mvc,Powermockito,我使用@Preparefortest内部类 @RunWith(PowerMockRunner.class) public class TestClass{ @PrepareForTest({myclass.class}) @Test() public void testCase1() throws Exception { mycode here } @Test() public void testCase2() throws Exception{ mycode
@RunWith(PowerMockRunner.class)
public class TestClass{
@PrepareForTest({myclass.class})
@Test()
public void testCase1() throws Exception {
mycode here
}
@Test()
public void testCase2() throws Exception{
mycode here
}
}
当我为类TestClass运行覆盖率测试时,它成功了!但是,当我只运行testCase1()时,它的错误初始化错误“java.lang.Exception:找不到与方法testCase1匹配的测试”。请提供更多信息,说明如何只运行一个TC?您使用哪种工具?我在intelliJ IDE 14.1.4中运行UT,并单击testCase1()的鼠标右键->选择运行“AuthenticateNormal…”以仅测试此情况。请提供有关如何仅运行一个TC的更多信息?您使用哪种工具?我在intelliJ IDE 14.1.4中运行UT,并单击testCase1()的鼠标右键->选择运行“authenticateNomal…”以仅测试此情况。