admin管理员组

文章数量:1530085

记录单元测试时的踩坑记录:
在webc层进行单元测试时,引入mockmvc之后。
经过:
@Before
public void setup() throws Exception {
// 初始化
MockitoAnnotations.openMocks(this);
// 构建mvc环境
mockMvc = MockMvcBuilders.standaloneSetup(operationController).build();
}
之后再使用**verify()**语句时便会报如下错:
Wanted but not invoked:
Actually, there were zero interactions with this mock.
的错误。

本文标签: 报错单元测试InvokedWanted