S3ChangeLogStore implements ChangeLogStore { @Override public List<String> getLocalDomainList() { if (lastModTime == 0) { lastModTime = System.currentTimeMillis(); } awsS3Client = getS3Client(); ArrayList<String> domains = new ArrayList<>(); listObjects(awsS3Client, domains, 0); tempSignedDomainMap.clear(); if (!getAllSignedDomains(domains)) { getAllSignedDomains(domains); } return domains; } S3ChangeLogStore();  S3ChangeLogStore(String awsRegion); @Override boolean supportsFullRefresh(); @Override SignedDomain getLocalSignedDomain(String domainName); @SuppressWarnings("EmptyMethod") @Override void removeLocalDomain(String domainName); @SuppressWarnings("EmptyMethod") @Override void saveLocalDomain(String domainName, SignedDomain signedDomain); @Override List<String> getLocalDomainList(); boolean getAllSignedDomains(List<String> domains); @Override Set<String> getServerDomainList(); @Override SignedDomains getServerDomainModifiedList(); @Override SignedDomain getServerSignedDomain(String domainName); @Override SignedDomains getUpdatedSignedDomains(StringBuilder lastModTimeBuffer); @Override void setLastModificationTimestamp(String newLastModTime); ExecutorService getExecutorService();  }
@Test public void testGetLocalDomainList() throws FileNotFoundException { MockS3ChangeLogStore store = new MockS3ChangeLogStore(0); InputStream is1 = new FileInputStream("src/test/resources/iaas.json"); MockS3ObjectInputStream s3Is1 = new MockS3ObjectInputStream(is1, null); InputStream is2 = new FileInputStream("src/test/resources/iaas.json"); MockS3ObjectInputStream s3Is2 = new MockS3ObjectInputStream(is2, null); S3Object object = mock(S3Object.class); when(object.getObjectContent()).thenReturn(s3Is1).thenReturn(s3Is2); when(store.awsS3Client.getObject("s3-unit-test-bucket-name", "iaas")).thenReturn(object); ObjectListing mockObjectListing = mock(ObjectListing.class); when(store.awsS3Client.listObjects(any(ListObjectsRequest.class))).thenReturn(mockObjectListing); List<S3ObjectSummary> tempList = new ArrayList<>(); S3ObjectSummary s3ObjectSummary = mock(S3ObjectSummary.class); when(s3ObjectSummary.getKey()).thenReturn("iaas"); tempList.add(s3ObjectSummary); when(mockObjectListing.getObjectSummaries()).thenReturn(tempList); List<String> temp = store.getLocalDomainList(); assertNotNull(temp); store.getLocalSignedDomain("iaas"); }