-
17 votesanswersviews
扩展API内部错误:org.powermock.api.extension.reporter.MockingFrameworkReporterFactoryImpl
我正在尝试使用PowerMockRunner编写单元测试但是我收到以下错误: java.lang.IllegalStateException:扩展API内部错误:org.powermock.api.extension.reporter.MockingFrameworkReporterFactoryImpl无法位于类路径中 . 在Org.powermock的org.powermock.tests.... -
0 votesanswersviews
带有JaCoCo ant检测任务的ExceptionInInitializerError
我是Java新手 . 我使用PowerMockito和JUnit测试用例,JaCoCo用于代码覆盖 . 一些谷歌搜索显示,PowerMockito不能与JaCoCo合作,并建议使用离线检测 . 我为JaCoCo检测创建了一个ant任务,在编译时,它抛出以下错误: java.lang.ExceptionInInitializerError at org.jacoco.core.ins... -
3 votesanswersviews
使用Mockito:在私有静态方法中匹配多个参数?
我一直在尝试使用Mockito和PowerMockito来测试我的代码 . 我有类似于以下类的东西: public class asdfClass{ public static String methodToMock(String item, String otheritem){ return "asdf"; } public stati... -
0 votesanswersviews
doNothing()方法调用实际方法
我在调用final void方法时尝试doNothing(),但doNothing()调用正在调用实际方法 . SwitchWorker类 public class SwitchWorker { public boolean switchMethod(String id){ this.methodA(id); return true; } ... -
0 votesanswersviews
如何使用JUnit在Spring Boot中公共方法中模拟私有方法
我想问你几个问题,并征求你的意见: 我想测试我的公共方法(我使用Spring Boot,Mockito,JUnit): @Service public class MyClass{ public Long getClientId(List<String> nameSurname) throws AuthorizationException { Long operato...