Class TigerTestHooks


  • public class TigerTestHooks
    extends Object
    This class integrates SerenityBDD and the Tiger test framework.

    Initializes Tiger (reading tiger.yaml, starting Tiger test environment manager, local proxy and optionally monitoring UI)

    Provides and Manages a NON thread safe RbelMessageProvider with two lists. One for reuse by Tiger validation steps and one internal for later usage.

    Forwards all steps to Monitoring UI, applying data variant substitution

    At the end of each scenario dumps all rbel messages to the file system and attaches it to the SerenityBDD report as test evidence.

    ATTENTION! As of now Tiger does not support collecting Rbel messages in a "thread safe" way, so that messages sent in parallel test execution scenarios are tracked. If you do run Tiger in parallel test execution, you must deal with concurrency of RBel messages yourself.

    • Constructor Detail

      • TigerTestHooks

        public TigerTestHooks()
    • Method Detail

      • parseFeatureFileAndResetRbelLog

        public void parseFeatureFileAndResetRbelLog​(io.cucumber.java.Scenario scenario)
        Initializes Tiger and rbel message listener and parses feature file and scenario steps.

        For scenario outlines the data variants are also parsed from the examples section.

        Parameters:
        scenario - Current scenario. Might be null if used by non BDD technologies (e.g. JUnit/TestNG tests).
      • registerRestAssuredFilter

        public static void registerRestAssuredFilter()
      • forwardToUiMonitor

        public void forwardToUiMonitor​(io.cucumber.java.Scenario scenario)
        If monitoring UI is active, each step is forwarded to the monitoring UI. For scenario outlines the step will be first parsed for data variant tags of pattern <key>, substituting it with the current value.

        Increases the current step index.

        Parameters:
        scenario - Current scenario. Might be null if used by non BDD technologies (e.g. JUnit/TestNG tests).
      • addRestAssuredRequestsToReport

        public void addRestAssuredRequestsToReport​(io.cucumber.java.Scenario scenario)
      • saveRbelMessagesToFile

        public void saveRbelMessagesToFile​(io.cucumber.java.Scenario scenario)
      • getValidatableRbelMessages

        public static List<de.gematik.rbellogger.data.RbelElement> getValidatableRbelMessages()
        List of messages received via local Tiger Proxy. You may clear/manipulate this list if you know what you do. It is used by the TGR validation steps. The list is not cleared at the end of / start of new scenarios! TODO add test to ensure this statement