Assert.assertTrue("Response has no fault", response.getSOAPBody().hasFault());
SOAPFault fault = response.getSOAPBody().getFault();
Assert.assertEquals("Invalid fault code", new QName("http://schemas.xmlsoap.org/soap/envelope/", "Client"),
fault.getFaultCodeAsQName());
Assert.assertEquals("Invalid fault string", endpoint.getFaultStringOrReason(), fault.getFaultString());
Detail detail = fault.getDetail();
Assert.assertNotNull("No detail", detail);
Iterator<?> iterator = detail.getDetailEntries();
Assert.assertTrue("No detail entry", iterator.hasNext());
DetailEntry detailEntry = (DetailEntry) iterator.next();
Assert.assertEquals("Invalid detail entry name",
new QName("http://springframework.org/spring-ws", "ValidationError"), detailEntry.getElementQName());
Assert.assertEquals("Invalid detail entry text", "Name is required", detailEntry.getTextContent());