@Test
public void resolve() throws Exception {

  when(transferManager.upload(anyString(), anyString(), any(InputStream.class), any(ObjectMetadata.class)))
      .thenReturn(upload);
  URI schemaUri = uriResolver.resolve(SCHEMA, ROAD, VERSION);
  verify(transferManager).upload(eq(BUCKET), eq("prefix/roads/road/schemas/1/road_v1.avsc"), uploadCaptor.capture(),
      metadataCaptor.capture());
  verify(upload).waitForCompletion();
  InputStream uploadStream = uploadCaptor.getValue();
  ByteArrayOutputStream out = new ByteArrayOutputStream();
  IOUtils.copy(uploadStream, out);
  String schemaString = new String(out.toByteArray(), Charsets.UTF_8);
  assertThat(schemaString, is(SCHEMA.toString()));
  ObjectMetadata objectMetadata = metadataCaptor.getValue();
  assertThat((int) objectMetadata.getContentLength(), is(out.toByteArray().length));
  assertThat(schemaUri, is(new URI("s3://bucket/prefix/roads/road/schemas/1/road_v1.avsc")));
}