@Test
public void testExtractXmlContentType() throws Exception {

  String mediaPackageId = "mp";
  String dc = "element1";
  try (InputStream in = getClass().getResourceAsStream("/dublincore.xml")) {
    endpoint.put(mediaPackageId, dc, "dublincore.xml", in);
  }
  // execute gets, and ensure that the content types are correct
  Response response = endpoint.restGet(mediaPackageId, dc, null);
  Assert.assertEquals("DC content type", "text/xml", response.getMetadata().getFirst("Content-Type"));
  // Make sure the image byte stream was not modified by the content type detection
  try (InputStream in = getClass().getResourceAsStream("/dublincore.xml")) {
    byte[] imageBytesFromClasspath = IOUtils.toByteArray(in);
    try (InputStream responseIn = (InputStream) response.getEntity()) {
      byte[] imageBytesFromRepo = IOUtils.toByteArray(responseIn);
      Assert.assertTrue(Arrays.equals(imageBytesFromClasspath, imageBytesFromRepo));
    }
  }
}