use of com.jayway.restassured.response.ValidatableResponse in project ddf by codice.
the class TestCatalogValidation method testEnforceValidityErrorsAndWarnings.
@Test
public void testEnforceValidityErrorsAndWarnings() throws Exception {
//Configure to enforce validator
configureEnforcedMetacardValidators(Collections.singletonList("sample-validator"), getAdminConfig());
//Configure to enforce errors and warnings
configureEnforceValidityErrorsAndWarnings("true", "true", getAdminConfig());
ingestXmlFromResourceWaitForFailure(XML_RECORD_RESOURCE_PATH + "/sampleWarningMetacard.xml");
ingestXmlFromResourceAndWait(XML_RECORD_RESOURCE_PATH + "/sampleCleanMetacard.xml");
ingestXmlFromResourceWaitForFailure(XML_RECORD_RESOURCE_PATH + "/sampleErrorMetacard.xml");
configureFilterInvalidMetacards("true", "false", getAdminConfig());
testWithRetry(() -> {
String query = new CswQueryBuilder().addAttributeFilter(PROPERTY_IS_LIKE, "AnyText", "*").getQuery();
ValidatableResponse response = given().header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_XML).body(query).post(CSW_PATH.getUrl()).then();
//clean metacard should be in results but not invalid ones
response.body(not(containsString("warning metacard")));
response.body(containsString("clean metacard"));
response.body(not(containsString("error metacard")));
});
}
use of com.jayway.restassured.response.ValidatableResponse in project ddf by codice.
the class TestCatalog method testCswDeleteMultiple.
@Test
public void testCswDeleteMultiple() {
ingestCswRecord();
ingestCswRecord();
ValidatableResponse response = given().header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_XML).body(getFileContent(CSW_REQUEST_RESOURCE_PATH + "/CswFilterDeleteRequest")).post(CSW_PATH.getUrl()).then();
response.body(hasXPath("//TransactionResponse/TransactionSummary/totalDeleted", is("2")), hasXPath("//TransactionResponse/TransactionSummary/totalInserted", is("0")), hasXPath("//TransactionResponse/TransactionSummary/totalUpdated", is("0")));
}
use of com.jayway.restassured.response.ValidatableResponse in project ddf by codice.
the class TestCatalog method testCswDeleteOneWithCQL.
@Test
public void testCswDeleteOneWithCQL() {
ingestCswRecord();
ValidatableResponse response = given().header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_XML).body(getFileContent(CSW_REQUEST_RESOURCE_PATH + "/CswCqlDeleteRequest", ImmutableMap.of("title", "Aliquam fermentum purus quis arcu"))).post(CSW_PATH.getUrl()).then();
response.body(hasXPath("//TransactionResponse/TransactionSummary/totalDeleted", is("1")), hasXPath("//TransactionResponse/TransactionSummary/totalInserted", is("0")), hasXPath("//TransactionResponse/TransactionSummary/totalUpdated", is("0")));
}
Aggregations