Home

Mockito完成单元测试

1.引入maven依赖 <dependency> <groupId>org.mockito</groupId> <artifactId>mockito-core</artifactId> <version>2.23.4</version> <scope>test</scope> </dependency> Note: 此处的scope最好选择test。 因为test的scope是不可以继承的,即使其他模块引用了你所在的模块,没有什么影响。由于该依赖和powermock(Mock静态方法依赖)存在版本不兼容问题,如果其他模块依赖了该模块...

Read more