public void testDisableAlarmActions() throws Exception { CloudWatchApi cloudWatchApi = requestSendsResponse(alarmRequest(ImmutableMap.of( "Action", "DisableAlarmActions", "AlarmNames.member.1", "TestAlarmName1", "AlarmNames.member.2", "TestAlarmName2", "Signature", "tvSfJ%2BgcrHowwUECSniV0TQP2OObpWCuba0S5dd723Y%3D" )), HttpResponse.builder() .statusCode(200) .payload(payloadFromResourceWithContentType("/VoidResponse.xml", "text/xml")) .build()); // Ensure there is no error returned cloudWatchApi.getAlarmApiForRegion(null).disable(ImmutableSet.of( "TestAlarmName1", "TestAlarmName2" )); }
public void testEnableAlarmActions() throws Exception { CloudWatchApi cloudWatchApi = requestSendsResponse(alarmRequest(ImmutableMap.of( "Action", "EnableAlarmActions", "AlarmNames.member.1", "TestAlarmName1", "AlarmNames.member.2", "TestAlarmName2", "Signature", "Q1VemnXpc57PKMs9NVCX6R%2B/TSDgsGzQwpOHQ70aJuU%3D" )), HttpResponse.builder() .statusCode(200) .payload(payloadFromResourceWithContentType("/VoidResponse.xml", "text/xml")) .build()); // Ensure there is no error returned cloudWatchApi.getAlarmApiForRegion(null).enable(ImmutableSet.of( "TestAlarmName1", "TestAlarmName2" )); }
public void testDisableAlarmActions() throws Exception { CloudWatchApi cloudWatchApi = requestSendsResponse(alarmRequest(ImmutableMap.of( "Action", "DisableAlarmActions", "AlarmNames.member.1", "TestAlarmName1", "AlarmNames.member.2", "TestAlarmName2", "Signature", "tvSfJ%2BgcrHowwUECSniV0TQP2OObpWCuba0S5dd723Y%3D" )), HttpResponse.builder() .statusCode(200) .payload(payloadFromResourceWithContentType("/VoidResponse.xml", "text/xml")) .build()); // Ensure there is no error returned cloudWatchApi.getAlarmApiForRegion(null).disable(ImmutableSet.of( "TestAlarmName1", "TestAlarmName2" )); }
Alarm.State state = Alarm.State.ALARM; CloudWatchApi cloudWatchApi = requestSendsResponse( alarmRequest(ImmutableMap.<String, String>builder() .put("Action", "DescribeAlarms") .put("ActionPrefix", actionPrefix)
public void testEnableAlarmActions() throws Exception { CloudWatchApi cloudWatchApi = requestSendsResponse(alarmRequest(ImmutableMap.of( "Action", "EnableAlarmActions", "AlarmNames.member.1", "TestAlarmName1", "AlarmNames.member.2", "TestAlarmName2", "Signature", "Q1VemnXpc57PKMs9NVCX6R%2B/TSDgsGzQwpOHQ70aJuU%3D" )), HttpResponse.builder() .statusCode(200) .payload(payloadFromResourceWithContentType("/VoidResponse.xml", "text/xml")) .build()); // Ensure there is no error returned cloudWatchApi.getAlarmApiForRegion(null).enable(ImmutableSet.of( "TestAlarmName1", "TestAlarmName2" )); }
Alarm.State state = Alarm.State.ALARM; CloudWatchApi cloudWatchApi = requestSendsResponse( alarmRequest(ImmutableMap.<String, String>builder() .put("Action", "DescribeAlarms") .put("ActionPrefix", actionPrefix)
Unit unit = Unit.SECONDS; CloudWatchApi cloudWatchApi = requestSendsResponse( alarmRequest(ImmutableMap.<String, String>builder() .put("Action", "DescribeAlarmsForMetric") .put("Dimensions.member.1.Name", "TestDimensionName1")
Unit unit = Unit.SECONDS; CloudWatchApi cloudWatchApi = requestSendsResponse( alarmRequest(ImmutableMap.<String, String>builder() .put("Action", "DescribeAlarmsForMetric") .put("Dimensions.member.1.Name", "TestDimensionName1")
public void testDescribeAlarmHistory() throws Exception { String alarmName = "TestAlarmName"; HistoryItemType historyItemType = HistoryItemType.ACTION; int maxRecords = 10; String endDateStr = "2013-01-02T00:00:00.000Z"; String startDateStr = "2013-01-01T00:00:00.000Z"; CloudWatchApi cloudWatchApi = requestSendsResponse( alarmRequest(ImmutableMap.<String, String> builder() .put("Action", "DescribeAlarmHistory") .put("AlarmName", alarmName) .put("EndDate", "2013-01-02T00%3A00%3A00.000Z") .put("HistoryItemType", historyItemType.toString()) .put("MaxRecords", Integer.toString(maxRecords)) .put("StartDate", "2013-01-01T00%3A00%3A00.000Z") .put("Signature", "O2u9yIQvCuVpKdUeUDJcswri0YD0sD4%2B/SR5TtYbPeQ%3D") .build()), HttpResponse.builder() .statusCode(200) .payload(payloadFromResourceWithContentType("/DescribeAlarmHistoryResponse.xml", "text/xml")) .build()); assertEquals(new ListAlarmHistoryResponseHandlerTest().expected().toString(), cloudWatchApi.getAlarmApiForRegion(null) .listHistory(new ListAlarmHistoryOptions() .alarmName("TestAlarmName") .endDate(dateService.iso8601DateParse(endDateStr)) .historyItemType(HistoryItemType.ACTION) .maxRecords(maxRecords) .startDate(dateService.iso8601DateParse(startDateStr)) ).get(0).toString()); }
public void testDescribeAlarmHistory() throws Exception { String alarmName = "TestAlarmName"; HistoryItemType historyItemType = HistoryItemType.ACTION; int maxRecords = 10; String endDateStr = "2013-01-02T00:00:00.000Z"; String startDateStr = "2013-01-01T00:00:00.000Z"; CloudWatchApi cloudWatchApi = requestSendsResponse( alarmRequest(ImmutableMap.<String, String> builder() .put("Action", "DescribeAlarmHistory") .put("AlarmName", alarmName) .put("EndDate", "2013-01-02T00%3A00%3A00.000Z") .put("HistoryItemType", historyItemType.toString()) .put("MaxRecords", Integer.toString(maxRecords)) .put("StartDate", "2013-01-01T00%3A00%3A00.000Z") .put("Signature", "O2u9yIQvCuVpKdUeUDJcswri0YD0sD4%2B/SR5TtYbPeQ%3D") .build()), HttpResponse.builder() .statusCode(200) .payload(payloadFromResourceWithContentType("/DescribeAlarmHistoryResponse.xml", "text/xml")) .build()); assertEquals(new ListAlarmHistoryResponseHandlerTest().expected().toString(), cloudWatchApi.getAlarmApiForRegion(null) .listHistory(new ListAlarmHistoryOptions() .alarmName("TestAlarmName") .endDate(dateService.iso8601DateParse(endDateStr)) .historyItemType(HistoryItemType.ACTION) .maxRecords(maxRecords) .startDate(dateService.iso8601DateParse(startDateStr)) ).get(0).toString()); }