summaryrefslogtreecommitdiffstats
path: root/holmes-actions/src/test/java
diff options
context:
space:
mode:
Diffstat (limited to 'holmes-actions/src/test/java')
-rw-r--r--holmes-actions/src/test/java/org/openo/holmes/common/producer/MQProducerTest.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/holmes-actions/src/test/java/org/openo/holmes/common/producer/MQProducerTest.java b/holmes-actions/src/test/java/org/openo/holmes/common/producer/MQProducerTest.java
index 58ea684..1390b77 100644
--- a/holmes-actions/src/test/java/org/openo/holmes/common/producer/MQProducerTest.java
+++ b/holmes-actions/src/test/java/org/openo/holmes/common/producer/MQProducerTest.java
@@ -67,6 +67,22 @@ public class MQProducerTest {
}
@Test
+ public void init() {
+ MQConfig mqConfig = new MQConfig();
+ mqConfig.brokerIp = "127.0.0.1";
+ mqConfig.brokerPort = 61616;
+ mqConfig.brokerPassword = "admin";
+ mqConfig.brokerUsername = "admin";
+ expect(mqConfigProvider.get()).andReturn(mqConfig).anyTimes();
+
+ PowerMock.replayAll();
+
+ mqProducer.init();
+
+ PowerMock.verifyAll();
+ }
+
+ @Test
public void sendAlarmMQTopicMsg() throws Exception {
Alarm alarm = new Alarm();
Connection connection = PowerMock.createMock(Connection.class);