public class CatalogTestCommons extends Object
Constructor and Description |
---|
CatalogTestCommons() |
Modifier and Type | Method and Description |
---|---|
static void |
deleteMetacard(String id)
Performs a delete request on the given metacard id
|
static void |
deleteMetacard(String id,
boolean checkResponse)
Performs a delete request on the given metacard id
|
static void |
deleteMetacard(String id,
int expectedStatusCode) |
static void |
deleteMetacardAndWait(String id)
Deletes a metacard by id and then waits until it has been removed from the catalog before
returning.
|
static void |
deleteMetacardUsingCswResponseId(com.jayway.restassured.response.Response response)
Uses ids within the responses to delete
|
static boolean |
doesMetacardExist(String id)
Does a wildcard search and verifies that one of the results is a metacard with the given id.
|
static String |
ingest(String data,
String mimeType)
Ingests the provided metacard
|
static String |
ingest(String data,
String mimeType,
boolean checkResponse)
Ingests the provided metacard
|
static String |
ingest(String data,
String mimeType,
int expectedStatusCode) |
static String |
ingestCswRecord(String cswRecord) |
static String |
ingestGeoJson(String json) |
static Map<String,String> |
ingestMetacards(Map<String,String> metacardsIds) |
static String |
ingestXmlFromResourceAndWait(String resourceName)
Ingests an xml resource by name.
|
static void |
update(String id,
String data,
String mimeType) |
static void |
update(String id,
String data,
String mimeType,
int expectedStatusCode) |
public static String ingest(String data, String mimeType)
data
- - body of the message containing metacard to be ingestedmimeType
- - content type header valuepublic static String ingest(String data, String mimeType, boolean checkResponse)
data
- - body of the message containing metacard to be ingestedmimeType
- - content type header valuecheckResponse
- - assert status code is 201public static String ingest(String data, String mimeType, int expectedStatusCode)
data
- - body of the message containing metacard to be ingestedmimeType
- - content type header valueexpectedStatusCode
- - expected status code to check forpublic static String ingestXmlFromResourceAndWait(String resourceName) throws IOException
resourceName
- - The relative path of the resource fileIOException
public static boolean doesMetacardExist(String id)
id
- The metacard id to look uppublic static void update(String id, String data, String mimeType)
id
- - id of metacard to updatedata
- - body of request to update withmimeType
- - content type header valuepublic static void update(String id, String data, String mimeType, int expectedStatusCode)
id
- - id of metacard to updatedata
- - body of request to update withmimeType
- - content type header valueexpectedStatusCode
- - expected status code to check forpublic static void deleteMetacardAndWait(String id)
id
- metacard id to deletepublic static void deleteMetacard(String id)
id
- - id of metacard to deletepublic static void deleteMetacard(String id, boolean checkResponse)
id
- - id of metacard to deletecheckResponse
- public static void deleteMetacard(String id, int expectedStatusCode)
public static void deleteMetacardUsingCswResponseId(com.jayway.restassured.response.Response response) throws IOException, XPathExpressionException
response
- - response with ids of metacards to deleteIOException
XPathExpressionException
This work is licensed under a Creative Commons Attribution 4.0 International License.