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 TypeClassDescriptionclass
class
class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final String
protected final String
protected final String
protected final String
protected int
protected org.apache.http.HttpRequest
A String representing the request.protected io.restassured.filter.log.RequestLoggingFilter
protected io.restassured.filter.log.ResponseLoggingFilter
protected URI
protected Object
An Object representing the content of the response message.protected URL
protected boolean
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAttributesOnTestFailure
(org.testng.ITestResult result) Augments the test result with supplementary attributes in the event that a test method failed.protected void
addServerUnderTest
(org.openapi4j.parser.model.v3.OpenApi3 openApi3) addServerUnderTest.protected void
checkHtmlConfClass
(String uri) Try to implement testing for A.5.void
clearMessages.protected CommonFixture.Input
createInput
(com.fasterxml.jackson.databind.JsonNode schemaNode, String id) createInput.protected CommonFixture.Output
createOutput
(com.fasterxml.jackson.databind.JsonNode schemaNode, String id) createOutput.getRequest.getResponse.protected io.restassured.specification.RequestSpecification
init()
init.void
initCommonFixture
(org.testng.ITestContext testContext) Initializes the common test fixture with a client component for interacting with HTTP endpoints.protected String
printResults
(org.openapi4j.core.validation.ValidationResults validationResults) printResults.protected boolean
validateResponseAgainstSchema
(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
String
object
-
getResponse
getResponse.
- Returns:
- a
String
object
-
init
protected io.restassured.specification.RequestSpecification init()init.
- Returns:
- a
RequestSpecification
object
-
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
- aString
object
-
printResults
printResults.
- Parameters:
validationResults
- aValidationResults
object- Returns:
- a
String
object
-
addServerUnderTest
protected void addServerUnderTest(org.openapi4j.parser.model.v3.OpenApi3 openApi3) addServerUnderTest.
- Parameters:
openApi3
- aOpenApi3
object
-
createInput
protected CommonFixture.Input createInput(com.fasterxml.jackson.databind.JsonNode schemaNode, String id) createInput.
- Parameters:
schemaNode
- aJsonNode
objectid
- aString
object- Returns:
- a
CommonFixture.Input
object
-
createOutput
protected CommonFixture.Output createOutput(com.fasterxml.jackson.databind.JsonNode schemaNode, String id) createOutput.
- Parameters:
schemaNode
- aJsonNode
objectid
- aString
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.
-