Class StubRunnerRule.PortStubRunnerRule
- java.lang.Object
-
- org.springframework.cloud.contract.stubrunner.junit.StubRunnerRule
-
- org.springframework.cloud.contract.stubrunner.junit.StubRunnerRule.PortStubRunnerRule
-
- All Implemented Interfaces:
org.junit.rules.TestRule,StubFinder,StubTrigger
- Enclosing class:
- StubRunnerRule
public static class StubRunnerRule.PortStubRunnerRule extends StubRunnerRule
Helper class with additional port, related methods once you pick a stub to download.- Since:
- 1.2.0
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.springframework.cloud.contract.stubrunner.junit.StubRunnerRule
StubRunnerRule.PortStubRunnerRule
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description org.springframework.cloud.contract.stubrunner.junit.PortStubRunnerRuleOptionsdownloadLatestStub(String groupId, String artifactId, String classifier)org.springframework.cloud.contract.stubrunner.junit.PortStubRunnerRuleOptionsdownloadStub(String ivyNotation)org.springframework.cloud.contract.stubrunner.junit.PortStubRunnerRuleOptionsdownloadStub(String groupId, String artifactId)org.springframework.cloud.contract.stubrunner.junit.PortStubRunnerRuleOptionsdownloadStub(String groupId, String artifactId, String version)org.springframework.cloud.contract.stubrunner.junit.PortStubRunnerRuleOptionsdownloadStub(String groupId, String artifactId, String version, String classifier)StubRunnerRuledownloadStubs(String... ivyNotations)StubRunnerRuledownloadStubs(List<String> ivyNotations)StubRunnerRulefailOnNoStubs(boolean failOnNoStubs)StubRunnerRulemaxPort(int maxPort)StubRunnerRulemessageVerifier(org.springframework.cloud.contract.verifier.messaging.MessageVerifier messageVerifier)Pass theMessageVerifierthat this rule should use.StubRunnerRuleminPort(int minPort)StubRunnerRuleoptions(StubRunnerOptions stubRunnerOptions)Override all options.StubRunnerRulerepoRoot(String repoRoot)StubRunnerRulestubsMode(StubRunnerProperties.StubsMode stubsMode)StubRunnerRulewithConsumerName(String consumerName)StubRunnerRulewithDeleteStubsAfterTest(boolean deleteStubsAfterTest)StubRunnerRulewithGenerateStubs(boolean generateStubs)StubRunnerRulewithHttpServerStubConfigurer(Class<? extends HttpServerStubConfigurer> httpServerStubConfigurer)StubRunnerRulewithMappingsOutputFolder(String mappingsOutputFolder)StubRunnerRulewithPort(Integer port)StubRunnerRulewithProperties(Map<String,String> properties)StubRunnerRulewithStubPerConsumer(boolean stubPerConsumer)-
Methods inherited from class org.springframework.cloud.contract.stubrunner.junit.StubRunnerRule
apply, downloadLatestStub, downloadStub, downloadStub, downloadStub, downloadStub, downloadStubs, downloadStubs, failOnNoStubs, findAllRunningStubs, findStubUrl, findStubUrl, getContracts, labels, maxPort, messageVerifier, minPort, options, repoRoot, stubsMode, trigger, trigger, trigger, withConsumerName, withDeleteStubsAfterTest, withGenerateStubs, withHttpServerStubConfigurer, withMappingsOutputFolder, withProperties, withStubPerConsumer
-
-
-
-
Method Detail
-
withPort
public StubRunnerRule withPort(Integer port)
-
messageVerifier
public abstract StubRunnerRule messageVerifier(org.springframework.cloud.contract.verifier.messaging.MessageVerifier messageVerifier)
Pass theMessageVerifierthat this rule should use. If you don't pass anything aExceptionThrowingMessageVerifierwill be used. That means that an exception will be thrown whenever you try to do sth messaging related.- Parameters:
messageVerifier- message verifier implementation- Returns:
- the rule
-
options
public abstract StubRunnerRule options(StubRunnerOptions stubRunnerOptions)
Override all options.- Parameters:
stubRunnerOptions- options of Stub Runner- Returns:
- the rule
- See Also:
StubRunnerOptions
-
minPort
public abstract StubRunnerRule minPort(int minPort)
- Parameters:
minPort- min value of port for WireMock server- Returns:
- the rule
-
maxPort
public abstract StubRunnerRule maxPort(int maxPort)
- Parameters:
maxPort- max value of port for WireMock server- Returns:
- the rule
-
repoRoot
public abstract StubRunnerRule repoRoot(String repoRoot)
- Parameters:
repoRoot- String URI of repository containing stubs- Returns:
- the rule
-
stubsMode
public abstract StubRunnerRule stubsMode(StubRunnerProperties.StubsMode stubsMode)
- Parameters:
stubsMode- Stubs mode that should be used- Returns:
- the rule
-
downloadStub
public abstract org.springframework.cloud.contract.stubrunner.junit.PortStubRunnerRuleOptions downloadStub(String groupId, String artifactId, String version, String classifier)
- Parameters:
groupId- group id of the stubartifactId- artifact id of the stubversion- version of the stubclassifier- classifier of the stub- Returns:
- the rule with port
-
downloadLatestStub
public abstract org.springframework.cloud.contract.stubrunner.junit.PortStubRunnerRuleOptions downloadLatestStub(String groupId, String artifactId, String classifier)
- Parameters:
groupId- group id of the stubartifactId- artifact id of the stubclassifier- classifier of the stub- Returns:
- the rule with port
-
downloadStub
public abstract org.springframework.cloud.contract.stubrunner.junit.PortStubRunnerRuleOptions downloadStub(String groupId, String artifactId, String version)
- Parameters:
groupId- group id of the stubartifactId- artifact id of the stubversion- version of the stub- Returns:
- the rule with port
-
downloadStub
public abstract org.springframework.cloud.contract.stubrunner.junit.PortStubRunnerRuleOptions downloadStub(String groupId, String artifactId)
- Parameters:
groupId- group id of the stubartifactId- artifact id of the stub- Returns:
- the rule with port
-
downloadStub
public abstract org.springframework.cloud.contract.stubrunner.junit.PortStubRunnerRuleOptions downloadStub(String ivyNotation)
- Parameters:
ivyNotation- Ivy notation of a single stub to download.- Returns:
- the rule with port
-
downloadStubs
public abstract StubRunnerRule downloadStubs(String... ivyNotations)
- Parameters:
ivyNotations- Stubs to download in Ivy notations.- Returns:
- the rule
-
downloadStubs
public abstract StubRunnerRule downloadStubs(List<String> ivyNotations)
- Parameters:
ivyNotations- Stubs to download in Ivy notations.- Returns:
- the rule
-
withStubPerConsumer
public abstract StubRunnerRule withStubPerConsumer(boolean stubPerConsumer)
- Parameters:
stubPerConsumer- Allows stub per consumer.- Returns:
- the rule
-
withConsumerName
public abstract StubRunnerRule withConsumerName(String consumerName)
- Parameters:
consumerName- given consumer name- Returns:
- the rule
-
withMappingsOutputFolder
public abstract StubRunnerRule withMappingsOutputFolder(String mappingsOutputFolder)
- Parameters:
mappingsOutputFolder- Allows setting the output folder for mappings- Returns:
- the rule
-
withDeleteStubsAfterTest
public abstract StubRunnerRule withDeleteStubsAfterTest(boolean deleteStubsAfterTest)
- Parameters:
deleteStubsAfterTest- If set tofalsewill NOT delete stubs from a temporary folder after running tests- Returns:
- the rule
-
withGenerateStubs
public abstract StubRunnerRule withGenerateStubs(boolean generateStubs)
- Parameters:
generateStubs- If set totruewill NOT load generated stubs but will generate stubs from contract definitions at runtime.- Returns:
- the rule
-
failOnNoStubs
public abstract StubRunnerRule failOnNoStubs(boolean failOnNoStubs)
- Parameters:
failOnNoStubs- when enabled, this flag will tell stub runner to throw an exception when no stubs / contracts were found.- Returns:
- the rule
-
withProperties
public abstract StubRunnerRule withProperties(Map<String,String> properties)
- Parameters:
properties- Map of properties that can be passed to customStubDownloaderBuilder- Returns:
- the rule
-
withHttpServerStubConfigurer
public abstract StubRunnerRule withHttpServerStubConfigurer(Class<? extends HttpServerStubConfigurer> httpServerStubConfigurer)
- Parameters:
httpServerStubConfigurer- Configuration for an HTTP server stub- Returns:
- the rule
-
-