@Test
public void upload_singleUpload_enforceMd5() throws Exception {

    UploadConfiguration uploadConfiguration =
            UploadConfiguration.builder().allowMultipartUploads(false).enforceMd5(true).build();
    UploadManager uploadManager = new UploadManager(objectStorage, uploadConfiguration);
    UploadRequest request = createUploadRequest();
    ArgumentCaptor<PutObjectRequest> putRequestCaptor =
            ArgumentCaptor.forClass(PutObjectRequest.class);
    PutObjectResponse putResponse = PutObjectResponse.builder().build();
    when(objectStorage.putObject(putRequestCaptor.capture())).thenReturn(putResponse);
    UploadResponse uploadResponse = uploadManager.upload(request);
    assertNotNull(uploadResponse);
    byte[] buffer = new byte[(int) CONTENT_LENGTH];
    putRequestCaptor.getValue().getPutObjectBody().read(buffer);
    assertEquals(CONTENT, new String(buffer));
    assertEquals(CONTENT_LENGTH, putRequestCaptor.getValue().getContentLength().longValue());
    assertEquals(
            "U2yw5mJhFHg/U4cBMrrFyw==",
            putRequestCaptor.getValue().getContentMD5()); // 'a' times content-length
}