Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
stubrunner:
spring.cloud.contract.stubrunner:
stubs-mode: local
stubs.ids: 'com.example:producer-kotlin-ftw-gradle:+:stubs:6569'
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
stubrunner:
spring.cloud.contract.stubrunner:
idsToServiceIds:

beer-api-producer: somenameforproducer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class BeerControllerClasspathTest extends AbstractTest {
@Autowired MockMvc mockMvc;
@Autowired BeerController beerController;

@Value("${stubrunner.runningstubs.beer-api-producer-restdocs.port}") int producerPort;
@Value("${spring.cloud.contract.stubrunner.runningstubs.beer-api-producer-restdocs.port}") int producerPort;

@BeforeEach
public void setupPort() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class BeerControllerForBarTest extends AbstractTest {
@Autowired MockMvc mockMvc;
@Autowired BeerController beerController;

@Value("${stubrunner.runningstubs.beer-api-producer-with-stubs-per-consumer.port}") int producerPort;
@Value("${spring.cloud.contract.stubrunner.runningstubs.beer-api-producer-with-stubs-per-consumer.port}") int producerPort;

@BeforeEach
public void setupPort() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class BeerControllerTest extends AbstractTest {
@Autowired MockMvc mockMvc;
@Autowired BeerController beerController;

@Value("${stubrunner.runningstubs.beer-api-producer-with-stubs-per-consumer.port}") int producerPort;
@Value("${spring.cloud.contract.stubrunner.runningstubs.beer-api-producer-with-stubs-per-consumer.port}") int producerPort;

@BeforeEach
public void setupPort() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class BeerControllerWithConsumerNameTest extends AbstractTest {

@Autowired MockMvc mockMvc;
@Autowired BeerController beerController;
@Value("${stubrunner.runningstubs.beer-api-producer-with-stubs-per-consumer.port}") int producerPort;
@Value("${spring.cloud.contract.stubrunner.runningstubs.beer-api-producer-with-stubs-per-consumer.port}") int producerPort;

@BeforeEach
public void setupPort() {
Expand Down
4 changes: 2 additions & 2 deletions docs/tutorials/snippets/consumer_flow_2.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ stubsMode = StubRunnerProperties.StubsMode.REMOTE
public class YourTestOnTheConsumerSide extends AbstractTest {
}
----
* Another option is to pass the property `stubrunner.repositoryRoot` either as a
system / environment property, or via an `application.yml` and `stubrunner.stubs-mode`
* Another option is to pass the property `spring.cloud.contract.stubrunner.repositoryRoot` either as a
system / environment property, or via an `application.yml` and `spring.cloud.contract.stubrunner.stubs-mode`
equal to `remote`
4 changes: 2 additions & 2 deletions docs/tutorials/spring_cloud_contract_advanced.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -589,15 +589,15 @@ include::{root}/consumer/src/test/java/com/example/GrumpyBartenderControllerTest
How can you retrieve the port value then? There are two ways of doing so:

* Autowire the field annotated with
`@Value("${stubrunner.runningstubs.artifactid.port}")`.
`@Value("${spring.cloud.contract.stubrunner.runningstubs.artifactid.port}")`.
* Use the autowired `StubFinder` interface, which includes the `findStub` method.

The following code shows an example of autowiring the field for
`beer-api-producer-advanced`:

[source,java]
----
@Value("${stubrunner.runningstubs.beer-api-producer-advanced.port}") int stubPort;
@Value("${spring.cloud.contract.stubrunner.runningstubs.beer-api-producer-advanced.port}") int stubPort;

@BeforeEach
public void setupPort() {
Expand Down
4 changes: 2 additions & 2 deletions docs/tutorials/spring_cloud_contract_advanced.html
Original file line number Diff line number Diff line change
Expand Up @@ -1288,7 +1288,7 @@ <h4 id="_cloned_producer">Cloned Producer</h4>
<ul>
<li>
<p>Autowire the field annotated with
<code>@Value("${stubrunner.runningstubs.artifactid.port}")</code>.</p>
<code>@Value("${spring.cloud.contract.stubrunner.runningstubs.artifactid.port}")</code>.</p>
</li>
<li>
<p>Use the autowired <code>StubFinder</code> interface, which includes the <code>findStub</code> method.</p>
Expand All @@ -1301,7 +1301,7 @@ <h4 id="_cloned_producer">Cloned Producer</h4>
</div>
<div class="listingblock">
<div class="content">
<pre class="prettyprint highlight"><code class="language-java" data-lang="java">@Value("${stubrunner.runningstubs.beer-api-producer-advanced.port}") int stubPort;
<pre class="prettyprint highlight"><code class="language-java" data-lang="java">@Value("${spring.cloud.contract.stubrunner.runningstubs.beer-api-producer-advanced.port}") int stubPort;

@BeforeEach
public void setupPort() {
Expand Down
4 changes: 2 additions & 2 deletions docs/tutorials/stubbing_out_service_discovery.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@ Now let's assume that we call the producer application by using the
`http://somenameforproducer/check` URL. You need to provide some properties to tell Stub
Runner that the given service name (in our case, `somenameforproducer`) should be mapped
to the running HTTP server stub of a given producer. Let's set those properties.
Stub Runner requires you to set the `stubrunner.idsToServiceIds` mapping in which the key
Stub Runner requires you to set the `spring.cloud.contract.stubrunner.idsToServiceIds` mapping in which the key
is the artifact ID and the value is the service name in the code. You also need to define
the `idsToServiceIds` property, as shown in the following code:

[source,yml]
----
stubrunner:
spring.cloud.contract.stubrunner:
idsToServiceIds:
beer-api-producer: somenameforproducer
----
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/stubbing_out_service_discovery.html
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ <h3 id="_consumer_flow_1">Consumer flow 1</h3>
</div>
<div class="listingblock">
<div class="content">
<pre class="prettyprint highlight"><code class="language-yml" data-lang="yml">stubrunner:
<pre class="prettyprint highlight"><code class="language-yml" data-lang="yml">spring.cloud.contract.stubrunner:
idsToServiceIds:
beer-api-producer: somenameforproducer</code></pre>
</div>
Expand Down
1 change: 0 additions & 1 deletion producer/src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
spring:
application.name: beer-api-producer
cloud.stream.bindings.output-out-0:

destination: verifications

server.port: ${PORT:8080}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
stubrunner:
spring.cloud.contract.stubrunner:
stubs-mode: local
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
stubrunner:
spring.cloud.contract.stubrunner:
ids: 'com.example:http-server-dsl:+:stubs:8080'
repositoryRoot: https://repo.spring.io/libs-snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class LoanApplicationServiceusingStubRunnerTests {
@Autowired
LoanApplicationService service;

@Value("${stubrunner.runningstubs.http-server-restdocs.port}")
@Value("${spring.cloud.contract.stubrunner.runningstubs.http-server-restdocs.port}")
int port;

@BeforeEach
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
@AutoConfigureStubRunner(ids = "com.example:http-server-restdocs")
class XmlServiceUsingStubRunnerTests {

@Value("${stubrunner.runningstubs.http-server-restdocs.port}")
@Value("${spring.cloud.contract.stubrunner.runningstubs.http-server-restdocs.port}")
int port;

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class LoanApplicationServiceusingStubRunnerGradleTests {
@Autowired
LoanApplicationService service;

@Value("${stubrunner.runningstubs.http-server-webclient.port}")
@Value("${spring.cloud.contract.stubrunner.runningstubs.http-server-webclient.port}")
int port;

@BeforeEach
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class LoanApplicationServiceusingStubRunnerTests {
@Autowired
LoanApplicationService service;

@Value("${stubrunner.runningstubs.http-server-webclient.port}")
@Value("${spring.cloud.contract.stubrunner.runningstubs.http-server-webclient.port}")
int port;

@BeforeEach
Expand Down
Loading