BaseStreamingTaskRunner implements TaskRunner { protected List<StreamingDistributionSummary> getAllExistingDistributions(String bucketName) { List<StreamingDistributionSummary> distListForBucket = new ArrayList<>(); StreamingDistributionList distList = cfClient.listStreamingDistributions(new ListStreamingDistributionsRequest()) .getStreamingDistributionList(); List<StreamingDistributionSummary> streamingDistList = distList.getItems(); while (distList.isTruncated()) { distList = cfClient.listStreamingDistributions( new ListStreamingDistributionsRequest().withMarker(distList.getNextMarker())) .getStreamingDistributionList(); streamingDistList.addAll(distList.getItems()); } for (StreamingDistributionSummary distSummary : streamingDistList) { if (isDistFromBucket(bucketName, distSummary)) { distListForBucket.add(distSummary); } } return distListForBucket; }  abstract String getName(); abstract String performTask(String taskParameters); static final String STREAMING_HOST_PROP; static final String STREAMING_TYPE_PROP; static final String S3_ORIGIN_SUFFIX; static final String S3_ORIGIN_OAI_PREFIX; }
@Test public void testGetAllExistingDistributionsAboveMax() throws Exception { BaseStreamingTaskRunner runner = createRunner(createMockStorageProvider(), createMockUnwrappedS3StorageProvider(), createMockS3ClientV1(), createMockCFClientV5(false, 3)); runner.getAllExistingDistributions("bucketName"); }