MultipartTransferManager { public void abortAll() { for (Future<Void> f : responses) { f.cancel(true); } }  synchronized void startTransfer(final UploadPartRequest request); void awaitCompletion(); void abortAll();  }
@Test public void abortAll() throws Exception { UploadPartRequest request1 = UploadPartRequest.builder().uploadPartNum(1).build(); final UploadPartResponse response1 = UploadPartResponse.builder().build(); when(service.uploadPart(request1)) .thenAnswer( new Answer<UploadPartResponse>() { @Override public UploadPartResponse answer(InvocationOnMock arg0) throws Throwable { Thread.sleep(10000L); return response1; } }); manager.startTransfer(request1); manager.abortAll(); List<Integer> inProgressParts = manifest.listInProgressParts(); assertEquals(1, inProgressParts.size()); assertEquals(1, inProgressParts.get(0).intValue()); }