@Test public void testIsStateInAlarm() { boolean alarmStatus = cwRaiderImplUnderTest.isStateInAlarm("test-alarm"); Assert.assertFalse(alarmStatus); }
@Override public boolean isStateInAlarm(String alarmName) { return !getCloudWatchAlarmByName(alarmName) .stream() .filter(x -> x.getStateValue().equalsIgnoreCase("ALARM")) .collect(Collectors.toList()) .isEmpty(); }
CloudWatchRaiderImpl implements CloudWatchRaider { @Override public boolean isStateInAlarm(String alarmName) { return !getCloudWatchAlarmByName(alarmName) .stream() .filter(x -> x.getStateValue().equalsIgnoreCase("ALARM")) .collect(Collectors.toList()) .isEmpty(); } }
CloudWatchRaiderImpl implements CloudWatchRaider { @Override public boolean isStateInAlarm(String alarmName) { return !getCloudWatchAlarmByName(alarmName) .stream() .filter(x -> x.getStateValue().equalsIgnoreCase("ALARM")) .collect(Collectors.toList()) .isEmpty(); } CloudWatchRaiderImpl(); }
CloudWatchRaiderImpl implements CloudWatchRaider { @Override public boolean isStateInAlarm(String alarmName) { return !getCloudWatchAlarmByName(alarmName) .stream() .filter(x -> x.getStateValue().equalsIgnoreCase("ALARM")) .collect(Collectors.toList()) .isEmpty(); } CloudWatchRaiderImpl(); @Override List<MetricAlarm> getCloudWatchAlarmByName(String alarmName); @Override boolean isStateInAlarm(String alarmName); @Override List<MetricAlarm> getCloudWatchAlarmByNameAndDate(String alarmName, Date afterDate); @Override Double getELBUnHealthyHostMetric(String loadBalancerName); @Override Double getELBMetric(String loadBalancerName, String metricName); @Override Double getEC2Metric(String instanceId, String metricName); @Override List<AlarmHistoryItem> getCloudWatchAlarmHistory(String alarmName); @Override AlarmStateValue getSimpleCloudWatchMetricAlarmStatus(String alarmName); @Override String getAlarmState(String alarmName); @Override Integer countAlarmsInState(String alarmState); }
CloudWatchRaiderImpl implements CloudWatchRaider { @Override public boolean isStateInAlarm(String alarmName) { return !getCloudWatchAlarmByName(alarmName) .stream() .filter(x -> x.getStateValue().equalsIgnoreCase("ALARM")) .collect(Collectors.toList()) .isEmpty(); } CloudWatchRaiderImpl(); @Override List<MetricAlarm> getCloudWatchAlarmByName(String alarmName); @Override boolean isStateInAlarm(String alarmName); @Override List<MetricAlarm> getCloudWatchAlarmByNameAndDate(String alarmName, Date afterDate); @Override Double getELBUnHealthyHostMetric(String loadBalancerName); @Override Double getELBMetric(String loadBalancerName, String metricName); @Override Double getEC2Metric(String instanceId, String metricName); @Override List<AlarmHistoryItem> getCloudWatchAlarmHistory(String alarmName); @Override AlarmStateValue getSimpleCloudWatchMetricAlarmStatus(String alarmName); @Override String getAlarmState(String alarmName); @Override Integer countAlarmsInState(String alarmState);  }