Search in sources :

Example 1 with BodyExtractorFilter

use of se.inera.intyg.webcert.web.integration.integrationtest.BodyExtractorFilter in project webcert by sklintyg.

the class CreateDraftCertificateV1IT method setup.

@Before
public void setup() throws IOException {
    // Setup String template resource
    templateGroup = new STGroupFile("integrationtestTemplates/createDraftCertificate.v1.stg");
    requestTemplate = templateGroup.getInstanceOf("request");
    xsdInputstream = ClasspathSchemaResourceResolver.load("interactions/CreateDraftCertificateInteraction/CreateDraftCertificateResponder_1.0.xsd");
    // We want to validate against the body of the response, and not the entire soap response. This filter will
    // extract that for us.
    responseBodyExtractorFilter = new BodyExtractorFilter(ImmutableMap.of("lc", "urn:riv:clinicalprocess:healthcond:certificate:CreateDraftCertificateResponder:1"), "soap:Envelope/soap:Body/lc:CreateDraftCertificateResponse");
    // Make a dummy request, ignore response...
    given().get("/services").then().statusCode(greaterThan(199));
}
Also used : STGroupFile(org.stringtemplate.v4.STGroupFile) BodyExtractorFilter(se.inera.intyg.webcert.web.integration.integrationtest.BodyExtractorFilter) Before(org.junit.Before)

Example 2 with BodyExtractorFilter

use of se.inera.intyg.webcert.web.integration.integrationtest.BodyExtractorFilter in project webcert by sklintyg.

the class CreateDraftCertificateV3IT method setup.

@Before
public void setup() throws IOException {
    // Setup String template resource
    templateGroup = new STGroupFile("integrationtestTemplates/createDraftCertificate.v3.stg");
    requestTemplate = templateGroup.getInstanceOf("request");
    xsdInputstream = ClasspathSchemaResourceResolver.load("interactions/CreateDraftCertificateInteraction/CreateDraftCertificateResponder_3.1.xsd");
    // We want to validate against the body of the response, and not the entire soap response. This filter will
    // extract that for us.
    responseBodyExtractorFilter = new BodyExtractorFilter(ImmutableMap.of("lc", "urn:riv:clinicalprocess:healthcond:certificate:CreateDraftCertificateResponder:3"), "soap:Envelope/soap:Body/lc:CreateDraftCertificateResponse");
}
Also used : STGroupFile(org.stringtemplate.v4.STGroupFile) BodyExtractorFilter(se.inera.intyg.webcert.web.integration.integrationtest.BodyExtractorFilter) Before(org.junit.Before)

Aggregations

Before (org.junit.Before)2 STGroupFile (org.stringtemplate.v4.STGroupFile)2 BodyExtractorFilter (se.inera.intyg.webcert.web.integration.integrationtest.BodyExtractorFilter)2