Browse Source

add ut

pull/3/MERGE
CalvinKirs 4 years ago
parent
commit
1622dde5db
  1. 6
      dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/AlertPluginInstanceServiceTest.java

6
dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/AlertPluginInstanceServiceTest.java

@ -86,12 +86,12 @@ public class AlertPluginInstanceServiceTest {
@Test
public void testDelete() {
List<String> ids = Arrays.asList("11,2,3",null,"98,1");
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);
}

Loading…
Cancel
Save