|
|
@ -102,6 +102,7 @@ public class AlertSenderTest { |
|
|
|
Map<String, AlertChannel> alertChannelMap = new ConcurrentHashMap<>(); |
|
|
|
Map<String, AlertChannel> alertChannelMap = new ConcurrentHashMap<>(); |
|
|
|
alertChannelMap.put(pluginName,alertChannelMock); |
|
|
|
alertChannelMap.put(pluginName,alertChannelMock); |
|
|
|
PowerMockito.when(alertPluginManager.getAlertChannelMap()).thenReturn(alertChannelMap); |
|
|
|
PowerMockito.when(alertPluginManager.getAlertChannelMap()).thenReturn(alertChannelMap); |
|
|
|
|
|
|
|
PowerMockito.when(alertPluginManager.getPluginNameById(Mockito.anyInt())).thenReturn("alert-plugin-mail"); |
|
|
|
|
|
|
|
|
|
|
|
alertSendResponseCommand = alertSender.syncHandler(alertGroupId, title, content); |
|
|
|
alertSendResponseCommand = alertSender.syncHandler(alertGroupId, title, content); |
|
|
|
Assert.assertFalse(alertSendResponseCommand.getResStatus()); |
|
|
|
Assert.assertFalse(alertSendResponseCommand.getResStatus()); |
|
|
@ -164,6 +165,7 @@ public class AlertSenderTest { |
|
|
|
String pluginName = "alert-plugin-mail"; |
|
|
|
String pluginName = "alert-plugin-mail"; |
|
|
|
PluginDefine pluginDefine = new PluginDefine(pluginName,"1",null); |
|
|
|
PluginDefine pluginDefine = new PluginDefine(pluginName,"1",null); |
|
|
|
PowerMockito.when(pluginDao.getPluginDefineById(pluginDefineId)).thenReturn(pluginDefine); |
|
|
|
PowerMockito.when(pluginDao.getPluginDefineById(pluginDefineId)).thenReturn(pluginDefine); |
|
|
|
|
|
|
|
PowerMockito.when(alertPluginManager.getPluginNameById(1)).thenReturn("alert-instance-mail"); |
|
|
|
|
|
|
|
|
|
|
|
AlertResult alertResult = new AlertResult(); |
|
|
|
AlertResult alertResult = new AlertResult(); |
|
|
|
alertResult.setStatus(String.valueOf(true)); |
|
|
|
alertResult.setStatus(String.valueOf(true)); |
|
|
|