@Test
public void uploadFails() {

    final AmazonClientException exception = new AmazonClientException("test");
    when(amazonS3Client.putObject("smartreceipts", FULL_KEY_PATH, file)).thenThrow(exception);
    TestObserver<String> testObserver = s3Manager.upload(file, PATH).test();
    verify(amazonS3Client).putObject("smartreceipts", FULL_KEY_PATH, file);
    testObserver.assertNoValues();
    testObserver.assertNotComplete();
    testObserver.assertError(exception);
}