Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static software.amazon.awssdk.testutils.service.AwsTestBase.isValidSdkServiceException;

import java.io.IOException;
import java.time.Duration;
Expand All @@ -42,7 +41,6 @@
import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider;
import software.amazon.awssdk.core.CompressionConfiguration;
import software.amazon.awssdk.core.SdkGlobalTime;
import software.amazon.awssdk.core.exception.SdkServiceException;
import software.amazon.awssdk.core.interceptor.SdkInternalExecutionAttribute;
import software.amazon.awssdk.core.internal.interceptor.trait.RequestCompression;
import software.amazon.awssdk.regions.Region;
Expand Down Expand Up @@ -368,9 +366,15 @@ private List<PutMetricAlarmRequest> createTwoNewAlarms(String metricName) {
*/
@Test
public void testExceptionHandling() throws Exception {
Instant endTime = Instant.now();
try {
cloudwatch.getMetricStatistics(GetMetricStatisticsRequest.builder()
.namespace("fake-namespace").build());
.namespace("fake-namespace")
.startTime(endTime.minus(Duration.ofMinutes(5)))
.endTime(endTime)
.period(60)
.statistics(Statistic.AVERAGE)
.build());
fail("Expected an SdkServiceException, but wasn't thrown");
} catch (MissingRequiredParameterException e) {
// There is a strong contract on the value of these fields, and they should never change unexpectedly
Expand Down
Loading