Class RBelValidatorGlue

java.lang.Object
de.gematik.test.tiger.glue.RBelValidatorGlue

public class RBelValidatorGlue extends Object
  • Constructor Details

    • RBelValidatorGlue

      public RBelValidatorGlue()
  • Method Details

    • getRbelValidator

      public static RbelMessageValidator getRbelValidator()
    • tgrSetRequestWaitTimeout

      @Gegebensei("TGR setze Anfrage Timeout auf {int} Sekunden") @Given("TGR set request wait timeout to {int} seconds") public void tgrSetRequestWaitTimeout(int waitsec)
      Specify the amount of seconds Tiger should wait when filtering for requests / responses before reporting them as not found.
    • tgrClearRecordedMessages

      @Wenn("TGR l\u00f6sche aufgezeichnete Nachrichten") @When("TGR clear recorded messages") public void tgrClearRecordedMessages()
      clear all validatable rbel messages. This does not clear the recorded messages later on reported via the rbel log HTML page or the messages shown on web ui of tiger proxies.
    • tgrFilterBasedOnHost

      @Wenn("TGR filtere Anfragen nach Server {string}") @When("TGR filter requests based on host {string}") public void tgrFilterBasedOnHost(String hostname)
      filter all subsequent findRequest steps for hostname. To reset set host name to empty string "".
      Parameters:
      hostname - host name (regex supported) to filter for
    • tgrFilterBasedOnMethod

      @Wenn("TGR filtere Anfragen nach HTTP Methode {string}") @When("TGR filter requests based on method {string}") public void tgrFilterBasedOnMethod(String method)
      filter all subsequent findRequest steps for method.
      Parameters:
      method - method to filter for
    • tgrResetRequestMethodFilter

      @Wenn("TGR l\u00f6sche den gesetzten HTTP Methodenfilter") @When("TGR reset request method filter") public void tgrResetRequestMethodFilter()
      reset filter for method for subsequent findRequest steps.
    • waitForMessageWithValue

      @Wenn("TGR warte auf eine Nachricht, in der Knoten {string} mit {string} \u00fcbereinstimmt") @When("TGR wait for message with node {string} matching {string}") public void waitForMessageWithValue(String rbelPath, String value)
      Wait until a message is found in which the given node, specified by a RbelPath-Expression, matches the given value. This method will NOT alter currentRequest/currentResponse!!
      Parameters:
      rbelPath - rbel path to node/attribute
      value - value to match at given node/attribute
    • waitForNewMessageWithValue

      @Wenn("TGR warte auf eine neue Nachricht, in der Knoten {string} mit {string} \u00fcbereinstimmt") @When("TGR wait for new message with node {string} matching {string}") public void waitForNewMessageWithValue(String rbelPath, String value)
      Wait until a NEW message is found in which the given node, specified by a RbelPath-Expression, matches the given value. NEW in this context means that the step will wait and check only messages which are received after the step has started. Any previously received messages will NOT be checked. Please also note that the currentRequest/currentResponse used by the find / find next steps are not altered by this step.
      Parameters:
      rbelPath - rbel path to node/attribute
      value - value to match at given node/attribute
    • findRequestToPath

      @Wenn("TGR finde die erste Anfrage mit Pfad {string}") @When("TGR find request to path {string}") public void findRequestToPath(String path)
      find the first request where the path equals or matches as regex and memorize it in the rbelValidator instance
      Parameters:
      path - path to match
    • findRequestToPathWithCommand

      @Wenn("TGR finde die erste Anfrage mit Pfad {string} und Knoten {string} der mit {string} \u00fcbereinstimmt") @When("TGR find request to path {string} with {string} matching {string}") public void findRequestToPathWithCommand(String path, String rbelPath, String value)
      find the first request where path and node value equal or match as regex and memorize it in the rbelValidator instance.
      Parameters:
      path - path to match
      rbelPath - rbel path to node/attribute
      value - value to match at given node/attribute
    • findNextRequestToPath

      @Wenn("TGR finde die n\u00e4chste Anfrage mit dem Pfad {string}") @When("TGR find next request to path {string}") public void findNextRequestToPath(String path)
      find the NEXT request where the path equals or matches as regex and memorize it in the rbelValidator instance.
      Parameters:
      path - path to match
    • findNextRequestToPathWithCommand

      @Wenn("TGR finde die n\u00e4chste Anfrage mit Pfad {string} und Knoten {string} der mit {string} \u00fcbereinstimmt") @When("TGR find next request to path {string} with {string} matching {string}") public void findNextRequestToPathWithCommand(String path, String rbelPath, String value)
      find the NEXT request where path and node value equal or match as regex and memorize it in the rbelValidator instance.
      Parameters:
      path - path to match
      rbelPath - rbel path to node/attribute
      value - value to match at given node/attribute
    • findFirstRequestToPathContainingNode

      @Wenn("TGR finde die erste Anfrage mit Pfad {string} die den Knoten {string} enth\u00e4lt") @When("TGR find request to path {string} containing node {string}") public void findFirstRequestToPathContainingNode(String path, String rbelPath)
      find the first request where path matches and request contains node with given rbel path and memorize it in the rbelValidator instance.
      Parameters:
      path - path to match
      rbelPath - rbel path to node/attribute
    • findNextRequestToPathContainingNode

      @Wenn("TGR finde die n\u00e4chste Anfrage mit Pfad {string} die den Knoten {string} enth\u00e4lt") @When("TGR find next request to path {string} containing node {string}") public void findNextRequestToPathContainingNode(String path, String rbelPath)
      find the NEXT request where path matches and request contains node with given rbel path and memorize it in the rbelValidator instance.
      Parameters:
      path - path to match
      rbelPath - rbel path to node/attribute
    • findLastRequestToPath

      @Wenn("TGR finde die letzte Anfrage mit dem Pfad {string}") @When("TGR find last request to path {string}") public void findLastRequestToPath(String path)
      find the LAST request where the path equals or matches as regex and memorize it in the rbelValidator instance.
      Parameters:
      path - path to match
    • findLastRequestToPathWithCommand

      @Wenn("TGR finde die letzte Anfrage mit Pfad {string} und Knoten {string} der mit {string} \u00fcbereinstimmt") @When("TGR find last request to path {string} with {string} matching {string}") public void findLastRequestToPathWithCommand(String path, String rbelPath, String value)
      find the LAST request where path and node value equal or match as regex and memorize it in the rbelValidator instance.
      Parameters:
      path - path to match
      rbelPath - rbel path to node/attribute
      value - value to match at given node/attribute
    • findLastRequest

      @Wenn("TGR finde die letzte Anfrage") @When("TGR find the last request") public void findLastRequest()
      find the LAST request.
    • findAnyMessageAttributeMatches

      @Wenn("TGR finde eine Nachricht mit Knoten {string} der mit {string} \u00fcbereinstimmt") @When("TGR any message with attribute {string} matches {string}") public void findAnyMessageAttributeMatches(String rbelPath, String value)
      Deprecated.
      assert that there is any message with given rbel path node/attribute matching given value. The matching will NOT perform regular expression matching but only checks for identical string content The result (request or response) will not be stored in the rbelValidator instance.
      Parameters:
      rbelPath - rbel path to node/attribute
      value - value to match at given node/attribute
    • storeCurrentResponseNodeTextValueInVariable

      @Dann("TGR speichere Wert des Knotens {string} der aktuellen Antwort in der Variable {string}") @Then("TGR store current response node text value at {string} in variable {string}") public void storeCurrentResponseNodeTextValueInVariable(String rbelPath, String varName)
      store given rbel path node/attribute text value of current response.
      Parameters:
      rbelPath - path to node/attribute
      varName - name of variable to store the node text value in
    • replaceContentOfVariable

      @Dann("TGR ersetze {string} mit {string} im Inhalt der Variable {string}") @Then("TGR replace {string} with {string} in content of variable {string}") public void replaceContentOfVariable(String regexPattern, String replace, String varName)
      replace stored content with given regex
      Parameters:
      regexPattern - regular expression to search for
      replace - string to replace all matches with
      varName - name of variable to store the node text value in
    • currentResponseBodyMatches

      @Dann("TGR pr\u00fcfe aktuelle Antwort stimmt im Body \u00fcberein mit:") @Then("TGR current response body matches:") public void currentResponseBodyMatches(String docString)
      assert that response body of filtered request matches.
      Parameters:
      docString - value / regex that should equal or match
    • currentResponseMessageContainsNode

      @Dann("TGR pr\u00fcfe aktuelle Antwort enth\u00e4lt Knoten {string}") @Then("TGR current response contains node {string}") public void currentResponseMessageContainsNode(String rbelPath)
      assert that response of filtered request contains node/attribute at given rbel path.
      Parameters:
      rbelPath - path to node/attribute
    • currentResponseMessageAttributeMatches

      @Dann("TGR pr\u00fcfe aktuelle Antwort stimmt im Knoten {string} \u00fcberein mit {string}") @Then("TGR current response with attribute {string} matches {string}") public void currentResponseMessageAttributeMatches(String rbelPath, String value)
      assert that response of filtered request matches at given rbel path node/attribute.
      Parameters:
      rbelPath - path to node/attribute
      value - value / regex that should equal or match as string content with MultiLine and DotAll regex option
    • currentResponseMessageAttributeDoesNotMatch

      @Dann("TGR pr\u00fcfe aktuelle Antwort stimmt im Knoten {string} nicht \u00fcberein mit {string}") @Then("TGR current response with attribute {string} does not match {string}") public void currentResponseMessageAttributeDoesNotMatch(String rbelPath, String value)
      assert that response of filtered request does not match at given rbel path node/attribute.
      Parameters:
      rbelPath - path to node/attribute
      value - value / regex that should NOT BE equal or should NOT match as string content with MultiLine and DotAll regex option
    • currentResponseMessageAtMatchesDocString

      @Dann("TGR pr\u00fcfe aktuelle Antwort im Knoten {string} stimmt \u00fcberein mit:") @Then("TGR current response at {string} matches:") public void currentResponseMessageAtMatchesDocString(String rbelPath, String docString)
      assert that response of filtered request matches at given rbel path node/attribute.
      Parameters:
      rbelPath - path to node/attribute
      docString - value / regex that should equal or match as string content with MultiLine and DotAll regex option supplied as DocString
    • currentResponseMessageAtDoesNotMatchDocString

      @Dann("TGR pr\u00fcfe aktuelle Antwort im Knoten {string} stimmt nicht \u00fcberein mit:") @Then("TGR current response at {string} does not match:") public void currentResponseMessageAtDoesNotMatchDocString(String rbelPath, String docString)
      assert that response of filtered request does not match at given rbel path node/attribute.
      Parameters:
      rbelPath - path to node/attribute
      docString - value / regex that should equal or match as string content with MultiLine and DotAll regex option supplied as DocString
    • currentResponseMessageAtMatches

      @Then("TGR current response at {string} matches {string}") public void currentResponseMessageAtMatches(String rbelPath, String value)
      Deprecated.
      assert that response of filtered request matches at given rbel path node/attribute.
      Parameters:
      rbelPath - path to node/attribute
      value - value / regex that should equal or match as string content with MultiLine and DotAll regex option
    • ModeType

      public ModeType ModeType(String mode)
    • currentResponseAtMatchesAsJsonOrXml

      @Dann("TGR pr\u00fcfe aktuelle Antwort im Knoten {string} stimmt als {ModeType} \u00fcberein mit:") @Then("TGR current response at {string} matches as {ModeType}:") public void currentResponseAtMatchesAsJsonOrXml(String rbelPath, ModeType mode, String oracleDocStr)
      assert that response of filtered request matches at given rbel path node/attribute assuming its JSON or XML
      Parameters:
      rbelPath - path to node/attribute
      mode - one of JSON|XML
      oracleDocStr - value / regex that should equal or match as JSON or XML content
      See Also:
    • currentResponseAtMatchesAsXMLAndDiffOptions

      @Dann("TGR pr\u00fcfe aktuelle Antwort im Knoten {string} stimmt als XML mit folgenden diff Optionen {string} \u00fcberein mit:") @Then("TGR current response at {string} matches as XML and diff options {string}:") public void currentResponseAtMatchesAsXMLAndDiffOptions(String rbelPath, String diffOptionsCSV, String xmlDocStr)
      assert that response of filtered request matches at given rbel path node/attribute assuming its XML with given list of diff options.
      Parameters:
      rbelPath - path to node/attribute
      diffOptionsCSV - a csv separated list of diff option identifiers to be applied to comparison of the two XML sources
      • nocomment ... DiffBuilder.ignoreComments()
      • txtignoreempty ... DiffBuilder.ignoreElementContentWhitespace()
      • txttrim ... DiffBuilder.ignoreWhitespace()
      • txtnormalize ... DiffBuilder.normalizeWhitespace()
      xmlDocStr - value / regex that should equal or match as JSON content
      See Also:
    • printCurrentResponse

      @Dann("TGR gebe aktuelle Response als Rbel-Tree aus") @Then("TGR print current response as rbel-tree") public void printCurrentResponse()
      Prints the rbel-tree of the current response to the System-out
    • printCurrentRequest

      @Dann("TGR gebe aktuelle Request als Rbel-Tree aus") @Then("TGR print current request as rbel-tree") public void printCurrentRequest()
      Prints the rbel-tree of the current request to the System-out
    • readTgrFile

      @Dann("TGR liest folgende .tgr Datei {string}") @Then("TGR reads the following .tgr file {string}") public void readTgrFile(String filePath)
      Read TGR file and sends messages to local Tiger proxy