diff --git a/pom.xml b/pom.xml index 3f6db67..f6257a7 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ - 1.0.0.33 + 1.0.0.35 true UTF-8 diff --git a/src/main/java/com/hpcloud/mon/infrastructure/thresholding/AlarmThresholdingBolt.java b/src/main/java/com/hpcloud/mon/infrastructure/thresholding/AlarmThresholdingBolt.java index b64bae2..f3af002 100644 --- a/src/main/java/com/hpcloud/mon/infrastructure/thresholding/AlarmThresholdingBolt.java +++ b/src/main/java/com/hpcloud/mon/infrastructure/thresholding/AlarmThresholdingBolt.java @@ -140,7 +140,7 @@ public class AlarmThresholdingBolt extends BaseRichBolt { LOG.debug("Alarm {} transitioned from {} to {}", alarm, initialState, alarm.getState()); AlarmStateTransitionedEvent event = new AlarmStateTransitionedEvent(alarm.getTenantId(), alarm.getId(), alarm.getName(), alarm.getDescription(), initialState, alarm.getState(), - stateChangeReason, getTimestamp()); + alarm.isActionsEnabled(), stateChangeReason, getTimestamp()); try { alarmEventForwarder.send(alertExchange, alertRoutingKey, Serialization.toJson(event)); } catch (Exception ignore) { diff --git a/src/test/java/com/hpcloud/mon/infrastructure/thresholding/AlarmThresholdingBoltTest.java b/src/test/java/com/hpcloud/mon/infrastructure/thresholding/AlarmThresholdingBoltTest.java index 05503da..c769766 100644 --- a/src/test/java/com/hpcloud/mon/infrastructure/thresholding/AlarmThresholdingBoltTest.java +++ b/src/test/java/com/hpcloud/mon/infrastructure/thresholding/AlarmThresholdingBoltTest.java @@ -105,6 +105,7 @@ public class AlarmThresholdingBoltTest { final String alarmJson = "{\"alarm-transitioned\":{\"tenantId\":\"" + tenantId + "\"," + "\"alarmId\":\"111111112222222222233333333334\",\"alarmName\":\"Test CPU Alarm\"," + "\"alarmDescription\":\"Description of Alarm\",\"oldState\":\"OK\",\"newState\":\"ALARM\"," + + "\"actionsEnabled\":true," + "\"stateChangeReason\":\"Thresholds were exceeded for the sub-alarms: [" + subAlarm.getExpression().getExpression() + "]\"," + "\"timestamp\":1395587091}}"; @@ -116,7 +117,11 @@ public class AlarmThresholdingBoltTest { final Tuple clearTuple = createSubAlarmStateChangeTuple(alarmId, subAlarm); bolt.execute(clearTuple); verify(collector, times(1)).ack(clearTuple); - final String okJson = "{\"alarm-transitioned\":{\"tenantId\":\"AAAAABBBBBBCCCCC\",\"alarmId\":\"111111112222222222233333333334\",\"alarmName\":\"Test CPU Alarm\",\"alarmDescription\":\"Description of Alarm\",\"oldState\":\"ALARM\",\"newState\":\"OK\",\"stateChangeReason\":\"The alarm threshold(s) have not been exceeded\",\"timestamp\":1395587091}}"; + final String okJson = "{\"alarm-transitioned\":{\"tenantId\":\"" + tenantId + "\"," + + "\"alarmId\":\"111111112222222222233333333334\",\"alarmName\":\"Test CPU Alarm\"," + + "\"alarmDescription\":\"Description of Alarm\",\"oldState\":\"ALARM\",\"newState\":\"OK\"," + + "\"actionsEnabled\":true," + + "\"stateChangeReason\":\"The alarm threshold(s) have not been exceeded\",\"timestamp\":1395587091}}"; verify(alarmEventForwarder, times(1)).send(ALERTS_EXCHANGE, ALERT_ROUTING_KEY, okJson); verify(alarmDAO, times(1)).updateState(alarmId, AlarmState.OK); }