public void checkAlreadyUsedOrValidHealthDashBoardToken(ServiceCode serviceCode) {
if(serviceCode.getHealthDashBoardToken().isEmpty()) {
return;
} else if(isAlreadyUsedHealthDashBoardToken(serviceCode)) {
throw new GlobalException(ResponseType.SERVICE_ALREADY_USED_HEALTH_DASHBOARD_TOKEN);
} else if(!isValidHealthDashBoardToken(serviceCode)) {
throw new GlobalException(ResponseType.SERVICE_NOT_VALID_HEALTH_DASHBOARD_TOKEN);
}
}
@Test(expected = GlobalException.class)
public void checkAlreadyUsedOrValidHealthDashBoardTokenTest() {
List<ServiceCode> serviceCodeList = new ArrayList<ServiceCode>();
serviceCodeList.add(serviceCode);
Mockito.when(serviceManageMapper.selectServiceByHashBoardToken((ServiceCode)notNull())).thenReturn(serviceCodeList);
// execute test
}
私はちょうど空のメソッドをテストしたいです。どのようにテストを実行できますか?私を助けてください。voidメソッドをテストするには?