|  | 
| 67 | 67 |  */ | 
| 68 | 68 | public class CloudWatchIntegrationTest extends AwsIntegrationTestBase { | 
| 69 | 69 | 
 | 
| 70 |  | -    private static final int ONE_WEEK_IN_MILLISECONDS = 1000 * 60 * 60 * 24 * 7; | 
|  | 70 | +    private static final int ONE_WEEK_IN_MILLISECONDS = 365 * 1000 * 60 * 60 * 24 * 7; | 
| 71 | 71 |     private static final int ONE_HOUR_IN_MILLISECONDS = 1000 * 60 * 60; | 
| 72 | 72 |     /** The CloudWatch client for all tests to use. */ | 
| 73 | 73 |     private static CloudWatchClient cloudwatch; | 
| @@ -164,38 +164,6 @@ public void put_get_metricdata_list_metric_returns_success() throws | 
| 164 | 164 |         assertTrue(seenDimensions); | 
| 165 | 165 |     } | 
| 166 | 166 | 
 | 
| 167 |  | - | 
| 168 |  | -    /** | 
| 169 |  | -     * Tests handling a "request too large" error. This breaks our parser right | 
| 170 |  | -     * now and is therefore disabled. | 
| 171 |  | -     */ | 
| 172 |  | - | 
| 173 |  | -    @Test | 
| 174 |  | -    public void put_metric_large_data_throws_request_entity_large_exception() | 
| 175 |  | -            throws Exception { | 
| 176 |  | -        String measureName = this.getClass().getName() + System.currentTimeMillis(); | 
| 177 |  | -        long now = System.currentTimeMillis(); | 
| 178 |  | -        double value = 42.0; | 
| 179 |  | - | 
| 180 |  | -        Collection<MetricDatum> data = new LinkedList<>(); | 
| 181 |  | -        for (int i = ONE_WEEK_IN_MILLISECONDS; i >= 0; i -= ONE_HOUR_IN_MILLISECONDS) { | 
| 182 |  | -            long time = now - i; | 
| 183 |  | -            MetricDatum datum = MetricDatum.builder().dimensions( | 
| 184 |  | -                    Dimension.builder().name("InstanceType").value("m1.small").build()) | 
| 185 |  | -                                                 .metricName(measureName).timestamp(Instant.now()) | 
| 186 |  | -                                                 .unit("Count").value(value).build(); | 
| 187 |  | -            data.add(datum); | 
| 188 |  | -        } | 
| 189 |  | - | 
| 190 |  | -        try { | 
| 191 |  | -            cloudwatch.putMetricData(PutMetricDataRequest.builder().namespace( | 
| 192 |  | -                    "AWS/EC2").metricData(data).build()); | 
| 193 |  | -            fail("Expected an error"); | 
| 194 |  | -        } catch (SdkServiceException e) { | 
| 195 |  | -            assertTrue(413 == e.statusCode()); | 
| 196 |  | -        } | 
| 197 |  | -    } | 
| 198 |  | - | 
| 199 | 167 |     /** | 
| 200 | 168 |      * Tests setting the state for an alarm and reading its history. | 
| 201 | 169 |      */ | 
|  | 
0 commit comments