@Test(expected = BmcException.class)
public void upload_multipartUpload_exception() {

    // results in 2 parts
    UploadConfiguration uploadConfiguration =
            UploadConfiguration.builder()
                    .minimumLengthForMultipartUpload(10)
                    .lengthPerUploadPart(10)
                    .allowParallelUploads(false)
                    .build();
    UploadManager uploadManager =
            new UploadManager(objectStorage, uploadConfiguration) {
                @Override
                protected MultipartObjectAssembler createAssembler(
                        PutObjectRequest request,
                        UploadRequest uploadRequest,
                        ExecutorService executorService) {
                    return assembler;
                }
            };
    UploadRequest request = createUploadRequest();
    when(assembler.newRequest(CONTENT_TYPE, CONTENT_LANG, CONTENT_ENCODING, METADATA))
            .thenReturn(new MultipartManifestImpl("uploadId"));
    when(assembler.commit()).thenThrow(new BmcException(false, "test", null, null));
    try {
        uploadManager.upload(request);
    } catch (Exception e) {
        verify(assembler).abort();
        throw e;
    }
}