Class StubRunnerRule

    • Constructor Detail

      • StubRunnerRule

        public StubRunnerRule()
    • Method Detail

      • apply

        public org.junit.runners.model.Statement apply​(org.junit.runners.model.Statement base,
                                                       org.junit.runner.Description description)
        Specified by:
        apply in interface org.junit.rules.TestRule
      • messageVerifier

        public StubRunnerRule messageVerifier​(org.springframework.cloud.contract.verifier.messaging.MessageVerifier messageVerifier)
      • withStubPerConsumer

        public StubRunnerRule withStubPerConsumer​(boolean stubPerConsumer)
      • withMappingsOutputFolder

        public StubRunnerRule withMappingsOutputFolder​(String mappingsOutputFolder)
      • withDeleteStubsAfterTest

        public StubRunnerRule withDeleteStubsAfterTest​(boolean deleteStubsAfterTest)
      • withGenerateStubs

        public StubRunnerRule withGenerateStubs​(boolean generateStubs)
      • failOnNoStubs

        public StubRunnerRule failOnNoStubs​(boolean failOnNoStubs)
      • findStubUrl

        public URL findStubUrl​(String groupId,
                               String artifactId)
        Description copied from interface: StubFinder
        For the given groupId and artifactId tries to find the matching URL of the running stub.
        Specified by:
        findStubUrl in interface StubFinder
        Parameters:
        groupId - - might be null. In that case a search only via artifactId takes place
        artifactId - - artifact id of the stub
        Returns:
        URL of a running stub or throws exception if not found
      • findStubUrl

        public URL findStubUrl​(String ivyNotation)
        Description copied from interface: StubFinder
        For the given Ivy notation [groupId]:artifactId:[version]:[classifier] tries to find the matching URL of the running stub. You can also pass only artifactId.
        Specified by:
        findStubUrl in interface StubFinder
        Parameters:
        ivyNotation - - Ivy representation of the Maven artifact
        Returns:
        URL of a running stub or throws exception if not found
      • trigger

        public boolean trigger​(String ivyNotation,
                               String labelName)
        Description copied from interface: StubTrigger
        Triggers an event by a given label for a given groupid:artifactid notation. You can use only artifactId too. Feature related to messaging.
        Specified by:
        trigger in interface StubTrigger
        Parameters:
        ivyNotation - ivy notation of a stub
        labelName - name of the label to trigger
        Returns:
        true - if managed to run a trigger
      • trigger

        public boolean trigger​(String labelName)
        Description copied from interface: StubTrigger
        Triggers an event by a given label. Feature related to messaging.
        Specified by:
        trigger in interface StubTrigger
        Parameters:
        labelName - name of the label to trigger
        Returns:
        true - if managed to run a trigger
      • trigger

        public boolean trigger()
        Description copied from interface: StubTrigger
        Triggers all possible events. Feature related to messaging.
        Specified by:
        trigger in interface StubTrigger
        Returns:
        true - if managed to run a trigger