提交 1622dde5 编写于 作者: C CalvinKirs

add ut

上级 4e2e055e
......@@ -85,13 +85,13 @@ public class AlertPluginInstanceServiceTest {
}
@Test
public void testDelete() {
List<String> ids = Arrays.asList("11,2,3",null,"98,1");
public void testDelete() {
List<String> ids = Arrays.asList("11,2,3", null, "98,1");
Mockito.when(alertGroupMapper.queryInstanceIdsList()).thenReturn(ids);
Map<String, Object> result= alertPluginInstanceService.delete(user, 1);
Map<String, Object> result = alertPluginInstanceService.delete(user, 1);
Assert.assertEquals(result.get(Constants.STATUS), Status.DELETE_ALERT_PLUGIN_INSTANCE_ERROR_HAS_ALERT_GROUP_ASSOCIATED);
Mockito.when(alertPluginInstanceMapper.deleteById(9)).thenReturn(1);
result= alertPluginInstanceService.delete(user, 9);
result = alertPluginInstanceService.delete(user, 9);
Assert.assertEquals(result.get(Constants.STATUS), Status.SUCCESS);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册