@Test
void downloadMetadataReturnsMetadataAsXMLFile() throws Exception
{

  InputStream resourceAsStream = CVCControllerTest.class.getResourceAsStream("/Metadata.xml");
  Mockito.when(metadataService.getMetadata()).thenReturn(ByteStreams.toByteArray(resourceAsStream));
  ResponseEntity<byte[]> responseEntity = controller.downloadMetadata();
  HttpStatus statusCode = responseEntity.getStatusCode();
  Assertions.assertEquals(HttpStatus.OK, statusCode);
  HttpHeaders headers = responseEntity.getHeaders();
  ContentDisposition contentDisposition = headers.getContentDisposition();
  Assertions.assertEquals("attachment", contentDisposition.getType());
  Assertions.assertEquals("Metadata.xml", contentDisposition.getFilename());
  Assertions.assertEquals(MediaType.APPLICATION_OCTET_STREAM, headers.getContentType());
  byte[] body = responseEntity.getBody();
  Assertions.assertFalse(ArrayUtil.isNullOrEmpty(body));
}