Modifier and Type | Method and Description |
---|---|
static int |
collectNumberOfAllReturnedFeatures(io.restassured.path.json.JsonPath jsonPath,
int maximumLimit)
Collects the number of all returned features by iterating over all 'next' links and summarizing the size of
features in 'features' array property.
|
static String |
findFeaturesUrlForGeoJson(URI rootUri,
io.restassured.path.json.JsonPath collection)
Finds the URL to the resource /collections/{collectionId}/items from the path /collections/{collectionId}
|
static String |
findFeaturesUrlForGeoJson(URI rootUri,
Map<String,Object> collection)
Finds the URL to the resource /collections/{collectionId}/items from the path /collections
|
static String |
findFeatureUrlForGeoJson(URI rootUri,
io.restassured.path.json.JsonPath collection,
String featureId)
Finds the URL to the resource /collections/{collectionId}/items/{featureId} from the path /collections and
creates an valid url to this resource
|
static String |
findFeatureUrlForGeoJson(URI rootUri,
Map<String,Object> collection,
String featureId)
Finds the URL to the resource /collections/{collectionId}/items/{featureId} from the path /collections and
creates an valid url to this resource
|
static Map<String,Object> |
findLinkByRel(List<Map<String,Object>> links,
String expectedRel)
Parses the link with 'rel=self'.
|
static List<String> |
findLinksWithoutRelOrType(List<Map<String,Object>> links,
Set<String> rels)
Parses the links without 'rel' or 'type' property.
|
static List<Map<String,Object>> |
findLinksWithSupportedMediaTypeByRel(List<Map<String,Object>> links,
List<String> mediaTypesToSupport,
String expectedRel)
Parses all links with 'type' of one of the passed mediaTypes and the 'rel' property with the passed value.
|
static List<String> |
findUnsupportedTypes(List<Map<String,Object>> links,
List<String> mediaTypesToSuppport)
Parsing the media types which does not have a link woth property 'type' for.
|
static String |
formatDate(LocalDate date)
Formats the passed string as ISO 8601 date.
|
static String |
formatDate(ZonedDateTime dateTime)
Formats the passed string as ISO 8601 date.
|
static String |
formatDateRange(ZonedDateTime beginDateTime,
ZonedDateTime endDateTime)
Formats the passed string as a period using a start and end time.
|
static String |
formatDateRangeWithDuration(LocalDate beginDate,
LocalDate endDate)
Formats the passed string as a period using start time and a duration.
|
static boolean |
hasAtLeastOneSpatialFeatureCollection(io.restassured.path.json.JsonPath jsonPath)
Checks if a at least one of the collection in the /collections response has a spatial extent.
|
static boolean |
hasAtLeastOneSpatialFeatureCollection(Map<String,Object> collection)
Checks if a at least one of the collection in the /collections response has a spatial extent.
|
static boolean |
hasAtLeastOneSpatialFeatureCollection(Object extent)
Checks if the extent contains a spatial extent.
|
static boolean |
hasProperty(String propertyName,
io.restassured.path.json.JsonPath jsonPath)
Checks if a property with the passed name exists in the jsonPath.
|
static boolean |
linkIncludesRelAndType(Map<String,Object> link)
Checks if the passed link contains 'rel' and 'type' properties.
|
static ZonedDateTime |
parseAsDate(String dateTime)
Parses the passed string as ISO 8601 date.
|
static List<String> |
parseAsList(String propertyName,
io.restassured.path.json.JsonPath jsonPath)
Retrieves the property values as list.
|
static List<String> |
parseAsList(String propertyName,
Map<String,Object> json)
Retrieves the property values as list.
|
static List<Map<String,Object>> |
parseAsListOfMaps(String propertyName,
io.restassured.path.json.JsonPath jsonPath)
Retrieves the property values as list.
|
static String |
parseAsString(Object value)
Parse value ass string.
|
static org.locationtech.jts.geom.Geometry |
parseFeatureGeometry(Map<String,Object> feature,
CoordinateSystem crs)
Parse the geometry property as geometry.
|
static String |
parseFeatureId(io.restassured.path.json.JsonPath collectionItemJson)
Parses the id of the first feature from the passed json.
|
static BBox |
parseSpatialExtent(Map<String,Object> collection)
Parses the spatial extent from the passed collection.
|
static TemporalExtent |
parseTemporalExtent(Map<String,Object> collection)
Parses the temporal extent from the passed collection.
|
public static String parseAsString(Object value)
value
- to parse, may be null
null
if the passed value was null
public static String parseFeatureId(io.restassured.path.json.JsonPath collectionItemJson)
collectionItemJson
- the json document containing the features, never null
null
if no feature could be foundpublic static TemporalExtent parseTemporalExtent(Map<String,Object> collection)
collection
- the collection containing the extent to parse, never null
null
if no extent existsIllegalArgumentException
- if the number of items in the extent invalidpublic static ZonedDateTime parseAsDate(String dateTime)
dateTime
- the dateTime to parse, never null
null
public static String formatDate(ZonedDateTime dateTime)
dateTime
- the dateTime to format, never null
null
public static String formatDate(LocalDate date)
date
- the dateTime to format, never null
null
public static String formatDateRange(ZonedDateTime beginDateTime, ZonedDateTime endDateTime)
beginDateTime
- the begin dateTime to format, never null
endDateTime
- the end dateTime to format, never null
null
public static String formatDateRangeWithDuration(LocalDate beginDate, LocalDate endDate)
beginDate
- the begin date to format, never null
endDate
- the end date to format, never null
null
public static BBox parseSpatialExtent(Map<String,Object> collection)
collection
- the collection containing the extent to parse, never null
null
if no extent existsIllegalArgumentException
- if the number of items in the extent invalidpublic static List<Map<String,Object>> findLinksWithSupportedMediaTypeByRel(List<Map<String,Object>> links, List<String> mediaTypesToSupport, String expectedRel)
links
- list of all links, never null
mediaTypesToSupport
- a list of media types the links searched for should support, may be empty but never null
expectedRel
- the expected value of the property 'rel', never null
null
public static List<String> findUnsupportedTypes(List<Map<String,Object>> links, List<String> mediaTypesToSuppport)
links
- list of links to search in, never null
mediaTypesToSuppport
- a list of media types which should be supported, never null
public static List<String> findLinksWithoutRelOrType(List<Map<String,Object>> links, Set<String> rels)
links
- list of links to search in, never null
rels
- Set of relation types, never null
public static Map<String,Object> findLinkByRel(List<Map<String,Object>> links, String expectedRel)
links
- list of links to search in, never null
expectedRel
- the expected value of the property 'rel', never null
null
if no such link existspublic static boolean linkIncludesRelAndType(Map<String,Object> link)
link
- to check, never null
true
if the link contains 'rel' and 'type' properties, false
otherwisepublic static boolean hasProperty(String propertyName, io.restassured.path.json.JsonPath jsonPath)
propertyName
- name of the property to check, never null
jsonPath
- to check, never null
true
if the property exists, false
otherwisepublic static boolean hasAtLeastOneSpatialFeatureCollection(io.restassured.path.json.JsonPath jsonPath)
jsonPath
- to check, never null
true
at least one of the collection has a spatial extent, false
otherwisepublic static boolean hasAtLeastOneSpatialFeatureCollection(Map<String,Object> collection)
collection
- to check, never null
true
at least one of the collection has a spatial extent, false
otherwisepublic static boolean hasAtLeastOneSpatialFeatureCollection(Object extent)
extent
- to check, never null
true
if extent contains a spatial extent, false
otherwisepublic static List<String> parseAsList(String propertyName, io.restassured.path.json.JsonPath jsonPath)
propertyName
- name of the property, never null
jsonPath
- the json document to retrieve properties from, never null
null
public static List<Map<String,Object>> parseAsListOfMaps(String propertyName, io.restassured.path.json.JsonPath jsonPath)
propertyName
- name of the property, never null
jsonPath
- the json document to retrieve properties from, never null
null
public static List<String> parseAsList(String propertyName, Map<String,Object> json)
propertyName
- name of the property, never null
json
- the json map to retrieve properties from, never null
null
public static int collectNumberOfAllReturnedFeatures(io.restassured.path.json.JsonPath jsonPath, int maximumLimit) throws URISyntaxException
jsonPath
- the initial collection, never null
maximumLimit
- the limit parameter value to use, if <= 0 the parameter is omittedURISyntaxException
- if the creation of a uri failspublic static String findFeaturesUrlForGeoJson(URI rootUri, io.restassured.path.json.JsonPath collection)
rootUri
- never null
collection
- the /collections/{collectionId} response, never null
null
public static String findFeaturesUrlForGeoJson(URI rootUri, Map<String,Object> collection)
rootUri
- never null
collection
- the collection object /collections response, never null
null
public static String findFeatureUrlForGeoJson(URI rootUri, io.restassured.path.json.JsonPath collection, String featureId)
rootUri
- never null
collection
- the /collections/{collectionId} response, never null
featureId
- id of the feature, never null
null
public static String findFeatureUrlForGeoJson(URI rootUri, Map<String,Object> collection, String featureId)
rootUri
- never null
collection
- the collection object /collections response, never null
featureId
- id of the feature, never null
null
public static org.locationtech.jts.geom.Geometry parseFeatureGeometry(Map<String,Object> feature, CoordinateSystem crs) throws org.locationtech.jts.io.ParseException
feature
- to parse, never null
crs
- the crs of the geometry, may be null
null
if the feature has no geometry propertyorg.locationtech.jts.io.ParseException
- if the geometry could not be parsedCopyright © 2024 Open Geospatial Consortium. All rights reserved.