/*
- * Copyright 2013-2016 the original author or authors.
+ * Copyright 2013-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -4608,7 +4691,9 @@ its methods as presented below:
@ContextConfiguration(classes = Config, loader = SpringBootContextLoader)
-@SpringBootTest(properties = [" stubrunner.cloud.enabled=false", "stubrunner.camel.enabled=false"])
+@SpringBootTest(properties = [" stubrunner.cloud.enabled=false",
+ "stubrunner.camel.enabled=false",
+ 'foo=${stubrunner.runningstubs.fraudDetectionServer.port}'])
@AutoConfigureStubRunner
@DirtiesContext
@ActiveProfiles("test")
@@ -4616,12 +4701,13 @@ class StubRunnerConfigurationSpec extends Specification {
@Autowired StubFinder stubFinder
@Autowired Environment environment
+ @Value('${foo}') Integer foo
@BeforeClass
@AfterClass
void setupProps() {
- System.clearProperty("stubrunner.repository.root");
- System.clearProperty("stubrunner.classifier");
+ System.clearProperty("stubrunner.repository.root")
+ System.clearProperty("stubrunner.classifier")
}
def 'should start WireMock servers'() {
@@ -4661,6 +4747,15 @@ class StubRunnerConfigurationSpec extends Specification {
stubFinder.findAllRunningStubs().getPort("fraudDetectionServer") == (environment.getProperty("stubrunner.runningstubs.fraudDetectionServer.port") as Integer)
}
+ def 'should be able to interpolate a running stub in the passed test property'() {
+ given:
+ int fraudPort = stubFinder.findAllRunningStubs().getPort("fraudDetectionServer")
+ expect:
+ fraudPort > 0
+ environment.getProperty("foo", Integer) == fraudPort
+ foo == fraudPort
+ }
+
@Configuration
@EnableAutoConfiguration
static class Config {}
@@ -5101,6 +5196,43 @@ the Stub Runner Boot.
Where port means the port of the WireMock server.
+
+
+
+|
+ Important
+ |
+
+Starting from version 1.0.4 as a version you can provide a range of versions that you would like
+the Stub Runner to take into consideration. You can read more about the Aether versioning ranges here.
+ |
+
+
+
+
+
+
+
+
This scheme accepts versions of any form, interpreting a version as a sequence of numeric and alphabetic segments. The characters '-', '_', and '.' as well as the mere
+transitions from digit to letter and vice versa delimit the version segments. Delimiters are treated as equivalent.
+
+
+
Numeric segments are compared mathematically, alphabetic segments are compared lexicographically and case-insensitively. However, the following qualifier strings are
+recognized and treated specially: "alpha" = "a" < "beta" = "b" < "milestone" = "m" < "cr" = "rc" < "snapshot" < "final" = "ga" < "sp". All of those well-known qualifiers
+are considered smaller/older than other strings. An empty segment/string is equivalent to 0.
+
+
+
In addition to the above mentioned qualifiers, the tokens "min" and "max" may be used as final version segment to denote the smallest/greatest version having a given prefix.
+For example, "1.2.min" denotes the smallest version in the 1.2 line, "1.2.max" denotes the greatest version in the 1.2 line. A version range of the form "[M.N.*]" is short for "[M.N.min, M.N.max]".
+
+
+
Numbers and strings are considered incomparable against each other. Where version segments of different kind would collide, comparison will instead assume that the previous
+segments are padded with trailing 0 or "ga" segments, respectively, until the kind mismatch is resolved, e.g. "1-alpha" = "1.0.0-alpha" < "1.0.1-ga" = "1.0.1".
+
+
+