@Test
public void singlePart() throws IOException {

  when(upload.start()).thenReturn(UPLOAD_ID);
  ArgumentCaptor<S3Part> partCaptor = ArgumentCaptor.forClass(S3Part.class);
  when(upload.upload(eq(UPLOAD_ID), partCaptor.capture())).thenReturn(partETag1);
  try (OutputStream output = new S3MultipartOutputStream(upload, 2, retry, asyncHandler)) {
    output.write(new byte[] { 0, 1 });
  }
  List<S3Part> parts = partCaptor.getAllValues();
  assertThat(parts.size(), is(1));
  S3Part part1 = parts.get(0);
  assertThat(part1.getNumber(), is(1));
  assertThat(part1.getSize(), is(2));
  assertThat(part1.getMd5(), is(MD5_FOR_BYTES_ZERO_ONE));
  assertThat(ByteStreams.toByteArray(part1.getInputStream()), is(new byte[] { 0, 1 }));
  verify(upload).complete(UPLOAD_ID, ImmutableList.of(partETag1));
}