@Test
public void testUpdateEventMetadataByType() throws IOException {

  String jsonString = IOUtils.toString(getClass().getResource("/event-metadata-update.json"), UTF_8);
  String expectedJson = IOUtils.toString(getClass().getResource("/event-metadata-update-expected.json"), UTF_8);
  String eventId = TestEventsEndpoint.METADATA_UPDATE_EVENT;
  given().formParam("metadata", jsonString).pathParam("event_id", eventId).queryParam("type", "dublincore/episode")
          .expect().statusCode(SC_NO_CONTENT).when().put(env.host("{event_id}/metadata"));
  MetadataList actualMetadataList = TestEventsEndpoint.getCapturedMetadataList2().getValue();
  assertThat(MetadataJson.collectionToJson(actualMetadataList.getMetadataByFlavor("dublincore/episode"), true).toString(),
          SameJSONAs.sameJSONAs(expectedJson).allowingAnyArrayOrdering());
}