import org.junit.rules.ExpectedException;
import org.onap.holmes.common.api.stat.Alarm;
import org.onap.holmes.common.api.entity.CorrelationResult;
+import org.onap.holmes.common.api.stat.VesAlarm;
import org.onap.holmes.common.config.MQConfig;
import org.powermock.api.easymock.PowerMock;
import org.powermock.modules.junit4.rule.PowerMockRule;
@Test
public void init() {
MQConfig mqConfig = new MQConfig();
- mqConfig.brokerIp = "127.0.0.1";
- mqConfig.brokerPort = 61616;
- mqConfig.brokerPassword = "admin";
- mqConfig.brokerUsername = "admin";
+ mqConfig.setBrokerIp("127.0.0.1");
+ mqConfig.setBrokerPort(61616);
+ mqConfig.setBrokerPassword("admin");
+ mqConfig.setBrokerUsername("admin");
expect(mqConfigProvider.get()).andReturn(mqConfig).anyTimes();
PowerMock.replayAll();
@Test
public void sendAlarmMQTopicMsg() throws Exception {
- Alarm alarm = new Alarm();
+ VesAlarm alarm = new VesAlarm();
Connection connection = PowerMock.createMock(Connection.class);
Session session = PowerMock.createMock(Session.class);
Destination destination = PowerMock.createMock(Topic.class);
@Test
public void sendAlarmMQTopicMsg_exception() throws Exception {
thrown.expect(JMSException.class);
- Alarm alarm = new Alarm();
+ VesAlarm alarm = new VesAlarm();
expect(connectionFactory.createConnection()).andThrow(new JMSException(""));