org.opengis.cite.ogcapiprocesses10.landingpage.LandingPage Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ets-ogcapi-processes10 Show documentation
Show all versions of ets-ogcapi-processes10 Show documentation
Describe purpose of test suite.
package org.opengis.cite.ogcapiprocesses10.landingpage;
import static io.restassured.http.ContentType.JSON;
import static io.restassured.http.ContentType.HTML;
import static io.restassured.http.Method.GET;
import static org.opengis.cite.ogcapiprocesses10.EtsAssert.assertTrue;
//import com.atlassian.oai.validator.OpenApiInteractionValidator;
//import com.atlassian.oai.validator.report.ValidationReport;
import com.networknt.schema.*;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
import com.fasterxml.jackson.core.JsonFactory;
import java.util.HashMap;
import com.fasterxml.jackson.databind.node.ObjectNode;
import java.net.URI;
//import org.apache.commons.io.IOUtils;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.logging.Level;
import org.opengis.cite.ogcapiprocesses10.CommonFixture;
import org.opengis.cite.ogcapiprocesses10.util.TestSuiteLogger;
import org.testng.annotations.Test;
import io.restassured.path.json.JsonPath;
import io.restassured.response.Response;
/**
*
* A.2.1. Landing Page {root}/
*
* @author Lyn Goltz
*/
public class LandingPage extends CommonFixture {
private JsonPath response;
private String body;
// private static String
// utrlSchema="http://schemas.opengis.net/ogcapi/common/part1/0.1/core/openapi/schemas/landingPage.json";
// private static String
// urlSchema="https://raw.githubusercontent.com/opengeospatial/ogcapi-processes/master/core/openapi/schemas/landingPage.yaml";
private static String urlSchema = "http://schemas.opengis.net/ogcapi/processes/part1/1.0/openapi/schemas/landingPage.yaml";
/**
*
* cf. core/abstract_tests/core/ATS_landingpage-op.adoc
* Abstract Test 1: /conf/core/landingpage-op
* Test Purpose: Validate that a landing page can be retrieved from the expected location.
* Requirement: /req/core/root-op
*
* Test Method:
* 1. Issue an HTTP GET request to the URL {root}/
* 2. Validate that a document was returned with a status code 200
* 3. Validate the contents of the returned document using test /conf/core/landingpage-success.
*
*/
@Test(description = "Implements Abstract Test 1: /conf/core/landingpage-op", groups = "A.2.1. Landing Page /")
public void testLandingPageRetrieval() {
Response request = init().baseUri(rootUri.toString()).accept(JSON).when().request(GET, "/");
TestSuiteLogger.log(Level.INFO, rootUri.toString());
request.then().statusCode(200);
response = request.jsonPath();
body = request.getBody().asString();
}
/**
*
* cf. core/abstract_tests/core/ATS_landingpage-success.adoc
*
*/
@Test(description = "Implements Abstract Test 2: /conf/core/landingpage-success", groups = "A.2.1. Landing Page /")
public void testLandingPageValidation() {
Response request = init().baseUri(rootUri.toString()).accept(JSON).when().request(GET, "/");
TestSuiteLogger.log(Level.INFO, rootUri.toString());
request.then().statusCode(200);
response = request.jsonPath();
List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy