单元测试
@Test(Excepted=BuinessException.class);
Mockito.verify(this.testService.times(3)).insertDataBase(Mockito.any());
assertThat(dialogJob.getNewList()).isNotEmpty()
code smell
pojo
TDD 3 laws
判断单元测试成功与否:
1、通过断言的返回值来判断
2、无返回值时,Mockito.verify(messageService,times(2)).insertAlertRelation(Mockito.any());
写单元测试失败test:
用@Test(Excepted=BuinessException.class);,抛了异常单元测试会通过