use of software.amazon.awssdk.services.cloudwatch.model.PutMetricDataResponse in project iep by Netflix.
the class PaginationTest method cloudwatchPut.
@Test
public void cloudwatchPut() throws Exception {
final AtomicInteger n = new AtomicInteger();
Function<PutMetricDataRequest, PutMetricDataResponse> f = r -> {
if (n.getAndIncrement() > 0) {
Assert.fail("non-paginated API called more than once");
}
return PutMetricDataResponse.builder().build();
};
Publisher<PutMetricDataResponse> publisher = Pagination.createPublisher(PutMetricDataRequest.builder().build(), f);
Iterable<PutMetricDataResponse> iter = Flowable.fromPublisher(publisher).blockingIterable();
int count = 0;
for (PutMetricDataResponse r : iter) {
++count;
}
Assert.assertEquals(1, count);
}
Aggregations