Class CatalogTestCommons

java.lang.Object
org.codice.ddf.itests.common.catalog.CatalogTestCommons

public class CatalogTestCommons extends Object
  • Field Details

  • Method Details

    • ingest

      public static String ingest(String data, String mimeType)
      Ingests the provided metacard
      Parameters:
      data - - body of the message containing metacard to be ingested
      mimeType - - content type header value
      Returns:
      id of ingested metacard
    • ingest

      public static String ingest(String data, String mimeType, boolean checkResponse)
      Ingests the provided metacard
      Parameters:
      data - - body of the message containing metacard to be ingested
      mimeType - - content type header value
      checkResponse - - assert status code is 201
      Returns:
      id of ingested metacard
    • ingest

      public static String ingest(String data, String mimeType, int expectedStatusCode)
      Parameters:
      data - - body of the message containing metacard to be ingested
      mimeType - - content type header value
      expectedStatusCode - - expected status code to check for
      Returns:
      id of ingested metacard
    • ingestWithBasicAuth

      public static String ingestWithBasicAuth(String data, String mimeType, String username, String password)
      Parameters:
      data - - body of the message containing metacard to be ingested
      mimeType - - content type header value
      username - - username of auth user
      password - - password of auth user
      Returns:
      id of ingested metacard
    • ingestWithBasicAuth

      public static String ingestWithBasicAuth(String data, String mimeType, String username, String password, int expectedStatusCode)
      Parameters:
      data - - body of the message containing metacard to be ingested
      mimeType - - content type header value
      username - - username of auth user
      password - - password of auth user
      expectedStatusCode - - expected status code to check for
      Returns:
      id of ingested metacard
    • ingestXmlFromResourceAndWait

      public static String ingestXmlFromResourceAndWait(String resourceName)
      Ingests an xml resource by name. Does not return until resource has been verified to be in the catalog
      Parameters:
      resourceName - - The relative path of the resource file
      Returns:
      metacard id
    • retryAssertionErrorCall

      public static <T> T retryAssertionErrorCall(Supplier<T> call, int retries, int waitPeriodSec)
    • ingestGeoJson

      public static String ingestGeoJson(String json)
    • ingestCswRecord

      public static String ingestCswRecord(String cswRecord)
    • query

      public static String query(String id, String transformer)
      Parameters:
      id - - id of metacard to query
      transformer - - transformer to use for response
    • query

      public static String query(String id, String transformer, int expectedStatusCode)
      Parameters:
      id - - id of metacard to query
      transformer - - transformer to use for response
      expectedStatusCode - - expected status code to check for
    • queryWithBasicAuth

      public static String queryWithBasicAuth(String id, String transformer, String username, String password)
      Parameters:
      id - - id of metacard to query
      transformer - - transformer to use for response
      username - - username of auth user
      password - - password of auth user
    • queryWithBasicAuth

      public static String queryWithBasicAuth(String id, String transformer, String username, String password, int expectedStatusCode)
      Parameters:
      id - - id of metacard to query
      transformer - - transformer to use for response
      username - - username of auth user
      password - - password of auth user
      expectedStatusCode - - expected status code to check for
    • update

      public static void update(String id, String data, String mimeType)
      Parameters:
      id - - id of metacard to update
      data - - body of request to update with
      mimeType - - content type header value
    • update

      public static void update(String id, String data, String mimeType, int expectedStatusCode)
      Parameters:
      id - - id of metacard to update
      data - - body of request to update with
      mimeType - - content type header value
      expectedStatusCode - - expected status code to check for
    • updateWithBasicAuth

      public static void updateWithBasicAuth(String id, String data, String mimeType, String username, String password)
      Parameters:
      id - - id of metacard to update
      mimeType - - content type header value
      username - - username of auth user
      password - - password of auth user
    • updateWithBasicAuth

      public static void updateWithBasicAuth(String id, String data, String mimeType, String username, String password, int expectedStatusCode)
      Parameters:
      id - - id of metacard to update
      mimeType - - content type header value
      username - - username of auth user
      password - - password of auth user
      expectedStatusCode - - expected status code to check for
    • delete

      public static void delete(String id)
      Parameters:
      id - - id of metacard to update
    • delete

      public static void delete(String id, int expectedStatusCode)
      Parameters:
      id - - id of metacard to update
      expectedStatusCode - - expected status code to check for
    • deleteWithBasicAuth

      public static void deleteWithBasicAuth(String id, String username, String password)
      Parameters:
      id - - id of metacard to update
      username - - username of auth user
      password - - password of auth user
    • deleteWithBasicAuth

      public static void deleteWithBasicAuth(String id, String username, String password, int expectedStatusCode)
      Parameters:
      id - - id of metacard to update
      username - - username of auth user
      password - - password of auth user
      expectedStatusCode - - expected status code to check for
    • deleteMetacardAndWait

      public static void deleteMetacardAndWait(String id)
      Deletes a metacard by id and then waits until it has been removed from the catalog before returning.
      Parameters:
      id - metacard id to delete
    • deleteMetacardUsingCswResponseId

      public static void deleteMetacardUsingCswResponseId(io.restassured.response.Response response) throws IOException, XPathExpressionException
      Uses ids within the responses to delete
      Parameters:
      response - - response with ids of metacards to delete
      Throws:
      IOException
      XPathExpressionException