
测试
sunxboy
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
用mockito来验证方法传参
@Captor private ArgumentCaptor<Map<String, String>> captor; @Before public void init() { MockitoAnnotations.initMocks(this); } public void test() {...原创 2013-11-20 10:54:59 · 1435 阅读 · 0 评论 -
Use cobertura test coverage tool instead of jacoco in sonar
1. download sonar zip , unzip to $SONAR_HOME folder 2. put below xml into settings.xml of maven <profile> <id>sonar</id> <activation> <activeByDefault...原创 2014-01-13 16:39:07 · 120 阅读 · 0 评论 -
Build Spring Unit test by using PowerMock with Mockito
sometimes we need to test final class or static class, at this time we need powermock. 1, update pom.xml to import powermock <dependency> <groupId>org.powermock</groupId> ...原创 2014-01-16 16:44:53 · 172 阅读 · 0 评论 -
How to mock void method using mockito
sometimes, we need to mock void method like this: public void printLine() { //... ... } how to mock it by using mockito ?here it is: Mockito.doNothing().when(handler).printLine(); ...原创 2014-01-17 13:07:28 · 134 阅读 · 0 评论 -
xml configuration of integration test with spring data mongo
1. junit test like below @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = {"/spring/test-mongo-setup.xml"}) public class AlarmLogDataHandlerTest extends AbstractDbDataTest...原创 2014-03-25 08:51:09 · 143 阅读 · 0 评论 -
spring data JPA的写法以及如何 测试
1。 pom 导入测试要用到的包 <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <scope>test</scope> </dependency> &原创 2015-05-22 10:33:34 · 606 阅读 · 0 评论