Class CommonFixture
java.lang.Object
org.opengis.cite.ogcapiprocesses10.CommonFixture
- Direct Known Subclasses:
CommonDataFixture,Conformance,GeneralHttp,JobList,Jobs,LandingPage,OGCProcessDescription,Process,ProcessList
A supporting base class that sets up a common test fixture. These configuration methods
are invoked before those defined in a subclass.
- Author:
- bpr
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassclassclass -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Stringprotected final Stringprotected final Stringprotected final Stringprotected intprotected org.apache.http.HttpRequestA String representing the request.protected io.restassured.filter.log.RequestLoggingFilterprotected io.restassured.filter.log.ResponseLoggingFilterprotected URIprotected ObjectAn Object representing the content of the response message.protected URLprotected boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAttributesOnTestFailure(org.testng.ITestResult result) Augments the test result with supplementary attributes in the event that a test method failed.protected voidaddServerUnderTest(org.openapi4j.parser.model.v3.OpenApi3 openApi3) addServerUnderTest.protected voidcheckHtmlConfClass(String uri) Try to implement testing for A.5.voidclearMessages.protected CommonFixture.InputcreateInput(com.fasterxml.jackson.databind.JsonNode schemaNode, String id) createInput.protected CommonFixture.OutputcreateOutput(com.fasterxml.jackson.databind.JsonNode schemaNode, String id) createOutput.getRequest.getResponse.protected io.restassured.specification.RequestSpecificationinit()init.voidinitCommonFixture(org.testng.ITestContext testContext) Initializes the common test fixture with a client component for interacting with HTTP endpoints.protected StringprintResults(org.openapi4j.core.validation.ValidationResults validationResults) printResults.protected booleanvalidateResponseAgainstSchema(String urlSchema, String body) validateResponseAgainstSchema.
-
Field Details
-
requestLoggingFilter
protected io.restassured.filter.log.RequestLoggingFilter requestLoggingFilter -
responseLoggingFilter
protected io.restassured.filter.log.ResponseLoggingFilter responseLoggingFilter -
specURL
-
rootUri
-
limit
protected int limit -
testAllProcesses
protected boolean testAllProcesses -
reqEntity
protected org.apache.http.HttpRequest reqEntityA String representing the request. -
rspEntity
An Object representing the content of the response message. -
CONTENT_TYPE
- See Also:
-
CONTENT_MEDIA_TYPE_PROPERTY_KEY
- See Also:
-
CONTENT_SCHEMA_PROPERTY_KEY
- See Also:
-
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
getRequest.
- Returns:
- a
Stringobject
-
getResponse
getResponse.
- Returns:
- a
Stringobject
-
init
protected io.restassured.specification.RequestSpecification init()init.
- Returns:
- a
RequestSpecificationobject
-
validateResponseAgainstSchema
validateResponseAgainstSchema.
-
checkHtmlConfClass
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- aStringobject
-
printResults
printResults.
- Parameters:
validationResults- aValidationResultsobject- Returns:
- a
Stringobject
-
addServerUnderTest
protected void addServerUnderTest(org.openapi4j.parser.model.v3.OpenApi3 openApi3) addServerUnderTest.
- Parameters:
openApi3- aOpenApi3object
-
createInput
protected CommonFixture.Input createInput(com.fasterxml.jackson.databind.JsonNode schemaNode, String id) createInput.
- Parameters:
schemaNode- aJsonNodeobjectid- aStringobject- Returns:
- a
CommonFixture.Inputobject
-
createOutput
protected CommonFixture.Output createOutput(com.fasterxml.jackson.databind.JsonNode schemaNode, String id) createOutput.
- Parameters:
schemaNode- aJsonNodeobjectid- aStringobject- Returns:
- a
CommonFixture.Outputobject
-
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.
-