编程语言
首页 > 编程语言> > Java 单元测试PowerMockito

Java 单元测试PowerMockito

作者:互联网

单元测试报错系列

Cannot instantiate @InjectMocks field named 'contractService'! Cause: the type 'ContractService' is an interface.
You haven't provided the instance at field declaration so I tried to construct the instance.

解决方案:将接口改成实现类

标签:PowerMockito,named,Java,instance,单元测试,field,报错
来源: https://www.cnblogs.com/mengjianzhou/p/14474290.html