From 47fcac5afd1cb59f3dd9e6cd6f632c997c5e4cee Mon Sep 17 00:00:00 2001 From: CalvinKirs Date: Tue, 26 Jan 2021 15:02:26 +0800 Subject: [PATCH] code smell --- .../api/service/AlertPluginInstanceServiceTest.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/AlertPluginInstanceServiceTest.java b/dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/AlertPluginInstanceServiceTest.java index 09deed03b5..049916f4ff 100644 --- a/dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/AlertPluginInstanceServiceTest.java +++ b/dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/AlertPluginInstanceServiceTest.java @@ -78,7 +78,7 @@ public class AlertPluginInstanceServiceTest { public void testCreate() { Mockito.when(alertPluginInstanceMapper.queryByInstanceName("test")).thenReturn(alertPluginInstances); Map result = alertPluginInstanceService.create(user, 1, "test", "test params"); - Assert.assertEquals(result.get(Constants.STATUS), Status.PLUGIN_INSTANCE_ALREADY_EXIT); + Assert.assertEquals(Status.PLUGIN_INSTANCE_ALREADY_EXIT, result.get(Constants.STATUS)); Mockito.when(alertPluginInstanceMapper.insert(Mockito.any())).thenReturn(1); result = alertPluginInstanceService.create(user, 1, "test1", "test params"); Assert.assertEquals(result.get(Constants.STATUS), Status.SUCCESS); @@ -89,10 +89,10 @@ public class AlertPluginInstanceServiceTest { List ids = Arrays.asList("11,2,3", null, "98,1"); Mockito.when(alertGroupMapper.queryInstanceIdsList()).thenReturn(ids); Map result = alertPluginInstanceService.delete(user, 1); - Assert.assertEquals(result.get(Constants.STATUS), Status.DELETE_ALERT_PLUGIN_INSTANCE_ERROR_HAS_ALERT_GROUP_ASSOCIATED); + Assert.assertEquals(Status.DELETE_ALERT_PLUGIN_INSTANCE_ERROR_HAS_ALERT_GROUP_ASSOCIATED, result.get(Constants.STATUS)); Mockito.when(alertPluginInstanceMapper.deleteById(9)).thenReturn(1); result = alertPluginInstanceService.delete(user, 9); - Assert.assertEquals(result.get(Constants.STATUS), Status.SUCCESS); + Assert.assertEquals(Status.SUCCESS, result.get(Constants.STATUS)); }