Version: 1.0.3.BUILD-SNAPSHOT
diff --git a/spring-cloud-contract.html b/spring-cloud-contract.html
index 78c20074a8..86228c46fe 100644
--- a/spring-cloud-contract.html
+++ b/spring-cloud-contract.html
@@ -4568,6 +4568,7 @@ its methods as presented below:
class StubRunnerConfigurationSpec extends Specification {
@Autowired StubFinder stubFinder
+ @Autowired Environment environment
@BeforeClass
@AfterClass
@@ -4604,6 +4605,15 @@ class StubRunnerConfigurationSpec extends Specification {
thrown(StubNotFoundException)
}
+ def 'should register started servers as environment variables'() {
+ expect:
+ environment.getProperty("stubrunner.runningstubs.loanIssuance.port") != null
+ stubFinder.findAllRunningStubs().getPort("loanIssuance") == (environment.getProperty("stubrunner.runningstubs.loanIssuance.port") as Integer)
+ and:
+ environment.getProperty("stubrunner.runningstubs.fraudDetectionServer.port") != null
+ stubFinder.findAllRunningStubs().getPort("fraudDetectionServer") == (environment.getProperty("stubrunner.runningstubs.fraudDetectionServer.port") as Integer)
+ }
+
@Configuration
@EnableAutoConfiguration
static class Config {}
@@ -4636,6 +4646,24 @@ Below you can find an example of achieving the same result by setting values on
repositoryRoot = "classpath:m2repo/repository/")
+
+
Stub Runner Spring registers environment variables in the following manner
+for every registered WireMock server. Example for Stub Runner ids
+ com.example:foo, com.example:bar.