diff --git a/1.1.x/multi/multi__spring_cloud_contract_verifier_introduction.html b/1.1.x/multi/multi__spring_cloud_contract_verifier_introduction.html index 2f8cb42cf9..b969f16e0d 100644 --- a/1.1.x/multi/multi__spring_cloud_contract_verifier_introduction.html +++ b/1.1.x/multi/multi__spring_cloud_contract_verifier_introduction.html @@ -71,7 +71,8 @@ You would like to feed that instance with a proper stub definition.
At som new HttpEntity<>(request, httpHeaders), FraudServiceResponse.class);
Annotate your test class with @AutoConfigureStubRunner. In the annotation provide the group id and artifact id for the Stub Runner to download stubs of your collaborators.
@RunWith(SpringRunner.class) @SpringBootTest(webEnvironment=WebEnvironment.NONE) -@AutoConfigureStubRunner(ids = {"com.example:http-server-dsl:+:stubs:6565"}, workOffline = true) +@AutoConfigureStubRunner(ids = {"com.example:http-server-dsl:+:stubs:6565"}, + stubsMode = StubRunnerProperties.StubsMode.LOCAL) @DirtiesContext public class LoanApplicationServiceTests {
After that, during the tests Spring Cloud Contract will automatically find the stubs (simulating the real service) in Maven repository and expose them on configured (or random) port.
Being a service Y since you are developing your stub, you need to be sure that it’s actually resembling your concrete implementation. You can’t have a situation where your stub acts in one way and your application on @@ -283,7 +284,8 @@ for more information. We highly recommend using the map notation!
Annotate your test class with @AutoConfigureStubRunner. In the annotation provide the group id and artifact id for the Stub Runner to download stubs of your collaborators. Also provide the offline work switch since you’re playing with the collaborators offline (optional step).
@RunWith(SpringRunner.class) @SpringBootTest(webEnvironment=WebEnvironment.NONE) -@AutoConfigureStubRunner(ids = {"com.example:http-server-dsl:+:stubs:6565"}, workOffline = true) +@AutoConfigureStubRunner(ids = {"com.example:http-server-dsl:+:stubs:6565"}, + stubsMode = StubRunnerProperties.StubsMode.LOCAL) @DirtiesContext public class LoanApplicationServiceTests {
Now if you run your tests you’ll see sth like this:
2016-07-19 14:22:25.403 INFO 41050 --- [ main] o.s.c.c.stubrunner.AetherStubDownloader : Desired version is + - will try to resolve the latest version 2016-07-19 14:22:25.438 INFO 41050 --- [ main] o.s.c.c.stubrunner.AetherStubDownloader : Resolved version is 0.0.1-SNAPSHOT diff --git a/1.1.x/single/spring-cloud-contract.html b/1.1.x/single/spring-cloud-contract.html index 5101b8f72e..3c3046ae86 100644 --- a/1.1.x/single/spring-cloud-contract.html +++ b/1.1.x/single/spring-cloud-contract.html @@ -75,7 +75,8 @@ You would like to feed that instance with a proper stub definition.At som new HttpEntity<>(request, httpHeaders), FraudServiceResponse.class);
Annotate your test class with @AutoConfigureStubRunner. In the annotation provide the group id and artifact id for the Stub Runner to download stubs of your collaborators.
@RunWith(SpringRunner.class) @SpringBootTest(webEnvironment=WebEnvironment.NONE) -@AutoConfigureStubRunner(ids = {"com.example:http-server-dsl:+:stubs:6565"}, workOffline = true) +@AutoConfigureStubRunner(ids = {"com.example:http-server-dsl:+:stubs:6565"}, + stubsMode = StubRunnerProperties.StubsMode.LOCAL) @DirtiesContext public class LoanApplicationServiceTests {
After that, during the tests Spring Cloud Contract will automatically find the stubs (simulating the real service) in Maven repository and expose them on configured (or random) port.
Being a service Y since you are developing your stub, you need to be sure that it’s actually resembling your concrete implementation. You can’t have a situation where your stub acts in one way and your application on @@ -287,7 +288,8 @@ for more information. We highly recommend using the map notation!
Annotate your test class with @AutoConfigureStubRunner. In the annotation provide the group id and artifact id for the Stub Runner to download stubs of your collaborators. Also provide the offline work switch since you’re playing with the collaborators offline (optional step).
@RunWith(SpringRunner.class) @SpringBootTest(webEnvironment=WebEnvironment.NONE) -@AutoConfigureStubRunner(ids = {"com.example:http-server-dsl:+:stubs:6565"}, workOffline = true) +@AutoConfigureStubRunner(ids = {"com.example:http-server-dsl:+:stubs:6565"}, + stubsMode = StubRunnerProperties.StubsMode.LOCAL) @DirtiesContext public class LoanApplicationServiceTests {
Now if you run your tests you’ll see sth like this:
2016-07-19 14:22:25.403 INFO 41050 --- [ main] o.s.c.c.stubrunner.AetherStubDownloader : Desired version is + - will try to resolve the latest version 2016-07-19 14:22:25.438 INFO 41050 --- [ main] o.s.c.c.stubrunner.AetherStubDownloader : Resolved version is 0.0.1-SNAPSHOT diff --git a/1.1.x/spring-cloud-contract.xml b/1.1.x/spring-cloud-contract.xml index 0a58440515..20c0ae6cc1 100644 --- a/1.1.x/spring-cloud-contract.xml +++ b/1.1.x/spring-cloud-contract.xml @@ -225,7 +225,8 @@ You would like to feed that instance with a proper stub definition.Annotate your test class with @AutoConfigureStubRunner . In the annotation provide the group id and artifact id for the Stub Runner to download stubs of your collaborators.@RunWith(SpringRunner.class) @SpringBootTest(webEnvironment=WebEnvironment.NONE) -@AutoConfigureStubRunner(ids = {"com.example:http-server-dsl:+:stubs:6565"}, workOffline = true) +@AutoConfigureStubRunner(ids = {"com.example:http-server-dsl:+:stubs:6565"}, + stubsMode = StubRunnerProperties.StubsMode.LOCAL) @DirtiesContext public class LoanApplicationServiceTests { After that, during the tests Spring Cloud Contract will automatically find the stubs (simulating the real service) in Maven repository and expose them on configured (or random) port. @@ -554,7 +555,8 @@ for more information. We highly recommend using the map notation!Annotate your test class with@AutoConfigureStubRunner . In the annotation provide the group id and artifact id for the Stub Runner to download stubs of your collaborators. Also provide the offline work switch since you’re playing with the collaborators offline (optional step).@RunWith(SpringRunner.class) @SpringBootTest(webEnvironment=WebEnvironment.NONE) -@AutoConfigureStubRunner(ids = {"com.example:http-server-dsl:+:stubs:6565"}, workOffline = true) +@AutoConfigureStubRunner(ids = {"com.example:http-server-dsl:+:stubs:6565"}, + stubsMode = StubRunnerProperties.StubsMode.LOCAL) @DirtiesContext public class LoanApplicationServiceTests { Now if you run your tests you’ll see sth like this: