@Test
public void testGetSignedDomain() throws IOException {

    MockS3ChangeLogStore store = new MockS3ChangeLogStore();
    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);
    // first we'll return null from our s3 client
    store.resetAWSS3Client();
    SignedDomain signedDomain = store.getLocalSignedDomain("iaas");
    assertNull(signedDomain);
    // next setup our mock aws return object
    when(store.awsS3Client.getObject("s3-unit-test-bucket-name", "iaas")).thenReturn(object);
    signedDomain = store.getLocalSignedDomain("iaas");
    assertNotNull(signedDomain);
    DomainData domainData = signedDomain.getDomain();
    assertNotNull(domainData);
    assertEquals(domainData.getName(), "iaas");
    signedDomain = store.getLocalSignedDomain("iaas");
    assertNotNull(signedDomain);
    is1.close();
    is2.close();
}