mockito官方文档地址: https://www.javadoc.io/doc/org.mockito/mockito-core/latest/org/mockito/Mockito.html#30
//using mocks - only mockOne is interacted
mockOne.add("one");
//ordinary verification
verify(mockOne).add("one"); // 验证调用过add one
//verify that method was never called on a mock
verify(mockOne, never()).add("two"); // 验证从未调用过add two
end.
标签:调用,mockOne,验证,--,mockito5.4,mockito,单元测试,add,verify From: https://www.cnblogs.com/zhuwenjoyce/p/17495744.html