// check we got a valid response with the document as a reference
checkValidationErrors(d);
assertEquals( "wps:ExecuteResponse", d.getDocumentElement().getNodeName() );
assertXpathExists("/wps:ExecuteResponse/wps:Status/wps:ProcessSucceeded", d);
assertXpathExists("/wps:ExecuteResponse/wps:ProcessOutputs/wps:Output/wps:Reference", d);
XpathEngine xpath = XMLUnit.newXpathEngine();
String fullLocation = xpath.evaluate("/wps:ExecuteResponse/wps:ProcessOutputs/wps:Output/wps:Reference/@href", d);
String resourceLocation = fullLocation.substring(fullLocation.indexOf('?') - 3);
MockHttpServletResponse response = getAsServletResponse(resourceLocation);
assertEquals("text/xml; subtype=wfs-collection/1.0", response.getContentType());
d = dom(new ByteArrayInputStream( response.getOutputStreamContent().getBytes()));
assertXpathExists("wfs:FeatureCollection", d);