@Test
public void testCreateAWSBucket() {

  // Bucket does not exist
  AmazonServiceException e = EasyMock.createNiceMock(AmazonServiceException.class);
  EasyMock.expect(e.getStatusCode()).andReturn(404);
  EasyMock.replay(e);
  EasyMock.expect(s3.listObjects(BUCKET_NAME)).andThrow(e).once();
  EasyMock.expect(s3.createBucket(BUCKET_NAME)).andReturn(EasyMock.anyObject(Bucket.class)).once();
  s3.setBucketPolicy(BUCKET_NAME, EasyMock.anyObject(String.class));
  EasyMock.expectLastCall().once();
  EasyMock.replay(s3);
  service.createAWSBucket();
  // Verify that all expected methods were called
  EasyMock.verify(s3);
}