Class CommonFixture

java.lang.Object
org.opengis.cite.ogcapiprocesses10.CommonFixture
Direct Known Subclasses:
CommonDataFixture, Conformance, GeneralHttp, JobList, Jobs, LandingPage, OGCProcessDescription, Process, ProcessList

public class CommonFixture extends Object
A supporting base class that sets up a common test fixture. These configuration methods are invoked before those defined in a subclass.
Author:
bpr
  • Field Details

    • requestLoggingFilter

      protected io.restassured.filter.log.RequestLoggingFilter requestLoggingFilter
    • responseLoggingFilter

      protected io.restassured.filter.log.ResponseLoggingFilter responseLoggingFilter
    • specURL

      protected URL specURL
    • rootUri

      protected URI rootUri
    • limit

      protected int limit
    • testAllProcesses

      protected boolean testAllProcesses
    • reqEntity

      protected org.apache.http.HttpRequest reqEntity
      A String representing the request.
    • rspEntity

      protected Object rspEntity
      An Object representing the content of the response message.
    • CONTENT_TYPE

      protected final String CONTENT_TYPE
      See Also:
    • CONTENT_MEDIA_TYPE_PROPERTY_KEY

      protected final String CONTENT_MEDIA_TYPE_PROPERTY_KEY
      See Also:
    • CONTENT_SCHEMA_PROPERTY_KEY

      protected final String CONTENT_SCHEMA_PROPERTY_KEY
      See Also:
    • CONTENT_ENCODING_PROPERTY_KEY

      protected final String CONTENT_ENCODING_PROPERTY_KEY
      See Also:
  • Constructor Details

    • CommonFixture

      public CommonFixture()
  • Method Details

    • initCommonFixture

      @BeforeClass public void initCommonFixture(org.testng.ITestContext testContext)
      Initializes the common test fixture with a client component for interacting with HTTP endpoints.
      Parameters:
      testContext - The test context that contains all the information for a test run, including suite attributes.
    • clearMessages

      @BeforeMethod public void clearMessages()

      clearMessages.

    • getRequest

      public String getRequest()

      getRequest.

      Returns:
      a String object
    • getResponse

      public String getResponse()

      getResponse.

      Returns:
      a String object
    • init

      protected io.restassured.specification.RequestSpecification init()

      init.

      Returns:
      a RequestSpecification object
    • validateResponseAgainstSchema

      protected boolean validateResponseAgainstSchema(String urlSchema, String body)

      validateResponseAgainstSchema.

      Parameters:
      urlSchema - a String object
      body - a String object
      Returns:
      a boolean
    • checkHtmlConfClass

      protected void checkHtmlConfClass(String uri)
      Try to implement testing for A.5. Conformance Class HTML TODO: Abtract Test 56: /conf/html/content Abtract Test 57: /conf/html/definition
      Parameters:
      uri - a String object
    • printResults

      protected String printResults(org.openapi4j.core.validation.ValidationResults validationResults)

      printResults.

      Parameters:
      validationResults - a ValidationResults object
      Returns:
      a String object
    • addServerUnderTest

      protected void addServerUnderTest(org.openapi4j.parser.model.v3.OpenApi3 openApi3)

      addServerUnderTest.

      Parameters:
      openApi3 - a OpenApi3 object
    • createInput

      protected CommonFixture.Input createInput(com.fasterxml.jackson.databind.JsonNode schemaNode, String id)

      createInput.

      Parameters:
      schemaNode - a JsonNode object
      id - a String object
      Returns:
      a CommonFixture.Input object
    • createOutput

      protected CommonFixture.Output createOutput(com.fasterxml.jackson.databind.JsonNode schemaNode, String id)

      createOutput.

      Parameters:
      schemaNode - a JsonNode object
      id - a String object
      Returns:
      a CommonFixture.Output object
    • addAttributesOnTestFailure

      @AfterMethod public void addAttributesOnTestFailure(org.testng.ITestResult result)
      Augments the test result with supplementary attributes in the event that a test method failed. The "request" attribute contains a String representing the request entity (POST method) or query component (GET method). The "response" attribute contains the content of the response entity.
      Parameters:
      result - A description of the test result.