Search in sources :

Example 1 with ParameterizedAcceptanceTest

use of gov.cms.qpp.test.annotations.ParameterizedAcceptanceTest in project qpp-conversion-tool by CMSgov.

the class ValidationApiFailureAcceptance method testBadPerformanceStart.

@ParameterizedAcceptanceTest
@MethodSource("getFailureScenarios")
void testBadPerformanceStart(String comparison, Map<String, String> override) {
    String qrda = getQrda(override);
    Response response = performRequest(qrda);
    assertThat(response.getStatusCode()).isEqualTo(HttpStatus.UNPROCESSABLE_ENTITY.value());
    AllErrors blah = response.getBody().as(AllErrors.class);
    blah.getErrors().stream().flatMap(error -> error.getDetails().stream()).forEach(verifyDetail(comparison, qrda));
}
Also used : Response(io.restassured.response.Response) Assertions.fail(org.junit.jupiter.api.Assertions.fail) AcceptanceTest(gov.cms.qpp.test.annotations.AcceptanceTest) XPathFactory(org.jdom2.xpath.XPathFactory) Mustache(com.github.mustachejava.Mustache) HashMap(java.util.HashMap) ExtendWith(org.junit.jupiter.api.extension.ExtendWith) ByteArrayInputStream(java.io.ByteArrayInputStream) Map(java.util.Map) MustacheFactory(com.github.mustachejava.MustacheFactory) MethodSource(org.junit.jupiter.params.provider.MethodSource) DefaultMustacheFactory(com.github.mustachejava.DefaultMustacheFactory) Filter(org.jdom2.filter.Filter) StringWriter(java.io.StringWriter) XmlUtils(gov.cms.qpp.conversion.xml.XmlUtils) ParameterizedAcceptanceTest(gov.cms.qpp.test.annotations.ParameterizedAcceptanceTest) Arguments(org.junit.jupiter.params.provider.Arguments) Truth.assertThat(com.google.common.truth.Truth.assertThat) XPathExpression(org.jdom2.xpath.XPathExpression) Consumer(java.util.function.Consumer) HttpStatus(org.springframework.http.HttpStatus) Detail(gov.cms.qpp.conversion.model.error.Detail) Attribute(org.jdom2.Attribute) Stream(java.util.stream.Stream) Response(io.restassured.response.Response) RestAssured.given(io.restassured.RestAssured.given) XmlException(gov.cms.qpp.conversion.xml.XmlException) Filters(org.jdom2.filter.Filters) AllErrors(gov.cms.qpp.conversion.model.error.AllErrors) Collections(java.util.Collections) AllErrors(gov.cms.qpp.conversion.model.error.AllErrors) MethodSource(org.junit.jupiter.params.provider.MethodSource) ParameterizedAcceptanceTest(gov.cms.qpp.test.annotations.ParameterizedAcceptanceTest)

Aggregations

DefaultMustacheFactory (com.github.mustachejava.DefaultMustacheFactory)1 Mustache (com.github.mustachejava.Mustache)1 MustacheFactory (com.github.mustachejava.MustacheFactory)1 Truth.assertThat (com.google.common.truth.Truth.assertThat)1 AllErrors (gov.cms.qpp.conversion.model.error.AllErrors)1 Detail (gov.cms.qpp.conversion.model.error.Detail)1 XmlException (gov.cms.qpp.conversion.xml.XmlException)1 XmlUtils (gov.cms.qpp.conversion.xml.XmlUtils)1 AcceptanceTest (gov.cms.qpp.test.annotations.AcceptanceTest)1 ParameterizedAcceptanceTest (gov.cms.qpp.test.annotations.ParameterizedAcceptanceTest)1 RestAssured.given (io.restassured.RestAssured.given)1 Response (io.restassured.response.Response)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1 StringWriter (java.io.StringWriter)1 Collections (java.util.Collections)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 Consumer (java.util.function.Consumer)1 Stream (java.util.stream.Stream)1 Attribute (org.jdom2.Attribute)1