// System.out.println(response.getOutputStreamContent());
// make sure we got a multipart
assertTrue(response.getContentType().matches("multipart/related;\\s*boundary=\".*\""));
// parse the multipart, check there are two parts
Multipart multipart = getMultipart(response);
assertEquals(2, multipart.getCount());
// now check the first part is a proper description
BodyPart coveragesPart = multipart.getBodyPart(0);
assertEquals("text/xml", coveragesPart.getContentType());
// System.out.println("Coverages part: " + coveragesPart.getContent());
assertEquals("<urn:ogc:wcs:1.1:coverages>", coveragesPart.getHeader("Content-ID")[0]);
// read the xml document into a dom
Document dom = dom(coveragesPart.getDataHandler().getInputStream());
checkValidationErrors(dom, WCS11_SCHEMA);
assertXpathEvaluatesTo(TASMANIA_BM.getLocalPart(),
"wcs:Coverages/wcs:Coverage/ows:Title", dom);
// the second part is the actual coverage
BodyPart coveragePart = multipart.getBodyPart(1);
assertEquals("image/tiff", coveragePart.getContentType());
assertEquals("<theCoverage>", coveragePart.getHeader("Content-ID")[0]);
}