public class StubRunnerRule extends Object implements org.junit.rules.TestRule, StubFinder
Constructor and Description |
---|
StubRunnerRule() |
Modifier and Type | Method and Description |
---|---|
org.junit.runners.model.Statement |
apply(org.junit.runners.model.Statement base,
org.junit.runner.Description description) |
StubRunnerRule |
downloadLatestStub(String groupId,
String artifactId,
String classifier)
Group Id, artifact Id and classifier of a single stub to download in the latest version
|
StubRunnerRule |
downloadStub(String ivyNotation)
Ivy notation of a single stub to download.
|
StubRunnerRule |
downloadStub(String groupId,
String artifactId)
Group Id, artifact Id of a single stub to download.
|
StubRunnerRule |
downloadStub(String groupId,
String artifactId,
String version)
Group Id, artifact Id and version of a single stub to download
|
StubRunnerRule |
downloadStub(String groupId,
String artifactId,
String version,
String classifier)
Group Id, artifact Id, version and classifier of a single stub to download
|
StubRunnerRule |
downloadStubs(List<String> ivyNotations)
Stubs to download in Ivy notations
|
StubRunnerRule |
downloadStubs(String... ivyNotations)
Stubs to download in Ivy notations
|
RunningStubs |
findAllRunningStubs()
Returns all running stubs
|
URL |
findStubUrl(String ivyNotation)
For the given Ivy notation
[groupId]:artifactId:[version]:[classifier] tries to
find the matching URL of the running stub. |
URL |
findStubUrl(String groupId,
String artifactId)
For the given groupId and artifactId tries to find the matching
URL of the running stub.
|
Map<StubConfiguration,Collection<org.springframework.cloud.contract.spec.Contract>> |
getContracts()
Returns the list of Contracts
|
Map<String,Collection<String>> |
labels()
Returns a mapping of ivy notation of a dependency to all the labels it has.
|
StubRunnerRule |
maxPort(int maxPort)
Max value of port for WireMock server
|
StubRunnerRule |
minPort(int minPort)
Min value of port for WireMock server
|
StubRunnerRule |
options(StubRunnerOptions stubRunnerOptions)
Override all options
|
StubRunnerRule |
repoRoot(String repoRoot)
String URI of repository containing stubs
|
boolean |
trigger()
Triggers all possible events.
|
boolean |
trigger(String labelName)
Triggers an event by a given label.
|
boolean |
trigger(String ivyNotation,
String labelName)
Triggers an event by a given label for a given
groupid:artifactid notation. |
StubRunnerRule |
withPort(Integer port)
Appends port to last added stub
|
StubRunnerRule |
workOffline(boolean workOffline)
Should download stubs or use only the local repository
|
public org.junit.runners.model.Statement apply(org.junit.runners.model.Statement base, org.junit.runner.Description description)
apply
in interface org.junit.rules.TestRule
public StubRunnerRule options(StubRunnerOptions stubRunnerOptions)
StubRunnerOptions
public StubRunnerRule minPort(int minPort)
public StubRunnerRule maxPort(int maxPort)
public StubRunnerRule repoRoot(String repoRoot)
public StubRunnerRule workOffline(boolean workOffline)
public StubRunnerRule downloadStub(String groupId, String artifactId, String version, String classifier)
public StubRunnerRule downloadLatestStub(String groupId, String artifactId, String classifier)
public StubRunnerRule downloadStub(String groupId, String artifactId, String version)
public StubRunnerRule downloadStub(String groupId, String artifactId)
public StubRunnerRule downloadStub(String ivyNotation)
public StubRunnerRule downloadStubs(String... ivyNotations)
public StubRunnerRule downloadStubs(List<String> ivyNotations)
public StubRunnerRule withPort(Integer port)
public URL findStubUrl(String groupId, String artifactId)
StubFinder
findStubUrl
in interface StubFinder
groupId
- - might be null. In that case a search only via artifactId takes placepublic URL findStubUrl(String ivyNotation)
StubFinder
[groupId]:artifactId:[version]:[classifier]
tries to
find the matching URL of the running stub. You can also pass only artifactId
.findStubUrl
in interface StubFinder
ivyNotation
- - Ivy representation of the Maven artifactpublic RunningStubs findAllRunningStubs()
StubFinder
findAllRunningStubs
in interface StubFinder
public Map<StubConfiguration,Collection<org.springframework.cloud.contract.spec.Contract>> getContracts()
StubFinder
getContracts
in interface StubFinder
public boolean trigger(String ivyNotation, String labelName)
StubTrigger
groupid:artifactid
notation. You can use only artifactId
too.
Feature related to messaging.trigger
in interface StubTrigger
public boolean trigger(String labelName)
StubTrigger
trigger
in interface StubTrigger
public boolean trigger()
StubTrigger
trigger
in interface StubTrigger
public Map<String,Collection<String>> labels()
StubTrigger
labels
in interface StubTrigger
Copyright © 2016–2017 Spring. All rights reserved.