@Test
public void testEditMedia() {
URI mediaUri = URI.create(endpoint + "/media/794eb334-754e-4917-b5a0-5df85cbd61d1");
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
new VcloudHttpRequestPrimer()
.apiCommand("PUT", "/media/794eb334-754e-4917-b5a0-5df85cbd61d1")
.xmlFilePayload("/media/editMedia.xml", VCloudDirectorMediaType.MEDIA)
.acceptMedia(VCloudDirectorMediaType.TASK)
.httpRequestBuilder().build(),
new VcloudHttpResponsePrimer()
.xmlFilePayload("/media/editMediaTask.xml", VCloudDirectorMediaType.TASK)
.httpResponseBuilder().build());
Media edit = editMedia();
Task expected = editMediaTask();
assertEquals(api.getMediaApi().edit(mediaUri, edit), expected);
}