Examples of CloudWatch


Examples of com.s3auth.hosts.Host.CloudWatch

     * DefaultHost can retrieve Cloudwatch stats and cache the results.
     */
    @Test
    public void retrievesAndCachesCloudWatchStats() {
        final long sum = 10;
        final CloudWatch cloudwatch = this.cloudWatch();
        final GetMetricStatisticsResult result = new GetMetricStatisticsResult()
            .withDatapoints(new Datapoint().withSum(Double.valueOf(sum)));
        Mockito.doReturn(result).when(cloudwatch.get())
            .getMetricStatistics(Mockito.any(GetMetricStatisticsRequest.class));
        MatcherAssert.assertThat(
            new DefaultHost(
                new BucketMocker().mock(),
                cloudwatch
            ).stats().bytesTransferred(),
            Matchers.allOf(
                Matchers.is(sum),
                Matchers.is(
                    new DefaultHost(
                        new BucketMocker().mock(),
                        cloudwatch
                    ).stats().bytesTransferred()
                )
            )
        );
        Mockito.verify(cloudwatch.get(), Mockito.times(1)).getMetricStatistics(
            Mockito.any(GetMetricStatisticsRequest.class)
        );
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.