Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/spring-mvc/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Unit testing 未找到与方法匹配的测试-单元测试PowerMockito_Unit Testing_Spring Mvc_Powermockito - Fatal编程技术网

Unit testing 未找到与方法匹配的测试-单元测试PowerMockito

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

我使用@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 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…”以仅测试此情况。