Class ETSAssert

java.lang.Object
org.opengis.cite.cat20.dgiwg10.ETSAssert

public class ETSAssert extends Object
Provides a set of custom assertion methods.
  • Method Details

    • assertStatusCode

      public static void assertStatusCode(int statusCode, int expectedStatusCode)
      Asserts that the status code matches the expected status code.
      Parameters:
      statusCode - the status code
      expectedStatusCode - the expected status code
    • assertXmlContentType

      public static void assertXmlContentType(jakarta.ws.rs.core.MultivaluedMap<String,Object> headers)
      Asserts that the header "Content-Type" contains a value with 'xml'.
      Parameters:
      headers - the available headers
    • assertTrue

      public static void assertTrue(boolean valueToAssert, String failureMsg)
      Parameters:
      valueToAssert - the boolean to assert to be true
      failureMsg - the message to throw in case of a failure, should not be null
    • assertQualifiedName

      public static void assertQualifiedName(Document document, String namespaceUri, String localName)
      Asserts that the qualified name of a Document root node matches the expected value.
      Parameters:
      document - The document to check the root node.
      namespaceUri - the expected namespace uri.
      localName - the expected local name.
    • assertQualifiedName

      public static void assertQualifiedName(Node node, String namespaceUri, String localName)
      Asserts that the qualified name of a DOM Node matches the expected value.
      Parameters:
      node - The Node to check.
      namespaceUri - the expected namespace uri.
      localName - the expected local name.
    • assertXPath

      public static void assertXPath(Node context, String expr)
      Asserts that an XPath 1.0 expression holds true for the given evaluation context. The standard namespace bindings from NamespaceBindings.withStandardBindings() are used.
      Parameters:
      context - The context node.
      expr - A valid XPath 1.0 expression.
    • assertXPath

      public static void assertXPath(Node context, String expr, Map<String,String> namespaceBindings)
      Asserts that an XPath 1.0 expression holds true for the given evaluation context. The standard namespace bindings from NamespaceBindings.withStandardBindings() must not be declared.
      Parameters:
      context - The context node.
      expr - A valid XPath 1.0 expression.
      namespaceBindings - A collection of namespace bindings for the XPath expression, where each entry maps a namespace URI (key) to a prefix (value). It may be null.
    • assertXPath

      public static void assertXPath(Node context, String expr, Map<String,String> namespaceBindings, String assertionErrorMessage)
      Asserts that an XPath 1.0 expression holds true for the given evaluation context. The standard namespace bindings from NamespaceBindings.withStandardBindings() must not be declared.
      Parameters:
      context - The context node.
      expr - A valid XPath 1.0 expression.
      namespaceBindings - A collection of namespace bindings for the XPath expression, where each entry maps a namespace URI (key) to a prefix (value). It may be null.
      assertionErrorMessage - message to throw if assertion failed, should not be null
    • assertSchemaValid

      public static void assertSchemaValid(Validator validator, Source source)
      Asserts that an XML resource is schema-valid.
      Parameters:
      validator - The Validator to use.
      source - The XML Source to be validated.