From 5f662bc526d8777caebcca4deb3a60614cc66c2f Mon Sep 17 00:00:00 2001 From: Dave Syer Date: Sat, 16 Jul 2016 15:02:53 +0100 Subject: [PATCH] Move stub runner server features to main module --- spring-cloud-contract-stub-runner/pom.xml | 1 - .../README.adoc | 54 ------------- .../pom.xml | 73 ------------------ .../main/resources/META-INF/spring.factories | 3 - .../src/test/resources/application.yml | 2 - .../README.adoc | 57 +++++++++++++- .../spring-cloud-contract-stub-runner/pom.xml | 5 ++ .../server/EnableStubRunnerServer.java | 44 +++++++++++ .../server}/HttpStubsController.java | 2 +- .../StubRunnerBackupAutoConfiguration.java} | 16 +--- .../stubrunner/server/StubRunnerBoot.java | 33 ++++++++ .../stubrunner/server}/TriggerController.java | 2 +- .../main/resources/META-INF/spring.factories | 3 + .../server}/StubRunnerBootSpec.groovy | 9 +-- .../src/test/resources/application.yml | 2 +- .../bootService-0.0.1-SNAPSHOT-stubs.jar | Bin .../bootService-0.0.1-SNAPSHOT.pom | 0 .../stubs/bootService/maven-metadata.xml | 0 18 files changed, 152 insertions(+), 154 deletions(-) delete mode 100644 spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner-boot/README.adoc delete mode 100644 spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner-boot/pom.xml delete mode 100644 spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner-boot/src/main/resources/META-INF/spring.factories delete mode 100644 spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner-boot/src/test/resources/application.yml create mode 100644 spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner/src/main/java/org/springframework/cloud/contract/stubrunner/server/EnableStubRunnerServer.java rename spring-cloud-contract-stub-runner/{spring-cloud-contract-stub-runner-boot/src/main/java/org/springframework/cloud/contract/stubrunner/boot => spring-cloud-contract-stub-runner/src/main/java/org/springframework/cloud/contract/stubrunner/server}/HttpStubsController.java (96%) rename spring-cloud-contract-stub-runner/{spring-cloud-contract-stub-runner-boot/src/main/java/org/springframework/cloud/contract/stubrunner/boot/StubRunnerBoot.java => spring-cloud-contract-stub-runner/src/main/java/org/springframework/cloud/contract/stubrunner/server/StubRunnerBackupAutoConfiguration.java} (73%) create mode 100644 spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner/src/main/java/org/springframework/cloud/contract/stubrunner/server/StubRunnerBoot.java rename spring-cloud-contract-stub-runner/{spring-cloud-contract-stub-runner-boot/src/main/java/org/springframework/cloud/contract/stubrunner/boot => spring-cloud-contract-stub-runner/src/main/java/org/springframework/cloud/contract/stubrunner/server}/TriggerController.java (97%) rename spring-cloud-contract-stub-runner/{spring-cloud-contract-stub-runner-boot/src/test/groovy/org/springframework/cloud/contract/stubrunner/boot => spring-cloud-contract-stub-runner/src/test/groovy/org/springframework/cloud/contract/stubrunner/server}/StubRunnerBootSpec.groovy (94%) rename spring-cloud-contract-stub-runner/{spring-cloud-contract-stub-runner-boot => spring-cloud-contract-stub-runner}/src/test/resources/m2repo/repository/org/springframework/cloud/contract/verifier/stubs/bootService/0.0.1-SNAPSHOT/bootService-0.0.1-SNAPSHOT-stubs.jar (100%) rename spring-cloud-contract-stub-runner/{spring-cloud-contract-stub-runner-boot => spring-cloud-contract-stub-runner}/src/test/resources/m2repo/repository/org/springframework/cloud/contract/verifier/stubs/bootService/0.0.1-SNAPSHOT/bootService-0.0.1-SNAPSHOT.pom (100%) rename spring-cloud-contract-stub-runner/{spring-cloud-contract-stub-runner-boot => spring-cloud-contract-stub-runner}/src/test/resources/m2repo/repository/org/springframework/cloud/contract/verifier/stubs/bootService/maven-metadata.xml (100%) diff --git a/spring-cloud-contract-stub-runner/pom.xml b/spring-cloud-contract-stub-runner/pom.xml index 99db2e11d4..def033ae30 100644 --- a/spring-cloud-contract-stub-runner/pom.xml +++ b/spring-cloud-contract-stub-runner/pom.xml @@ -20,7 +20,6 @@ spring-cloud-contract-stub-runner spring-cloud-contract-stub-runner-jetty - spring-cloud-contract-stub-runner-boot spring-cloud-contract-stub-runner-messaging diff --git a/spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner-boot/README.adoc b/spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner-boot/README.adoc deleted file mode 100644 index 2d61693159..0000000000 --- a/spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner-boot/README.adoc +++ /dev/null @@ -1,54 +0,0 @@ -=== Stub Runner Boot - -Spring Cloud Contract Verifier Stub Runner Boot is a Spring Boot application that exposes REST endpoints to -trigger the messaging labels and to access started WireMock servers. - -One of the usecases is to run some smoke (end to end) tests on a deployed application. You can read - more about this in the http://toomuchcoding.com/blog/2015/09/27/microservice-deployment/["Microservice Deployment" article at Too Much Coding blog.] - -==== How to use it? - -Just add the - -[source,groovy,indent=0] ----- -compile "org.springframework.cloud:stub-runner-boot:${verifierVersion}" ----- - -and a messaging implementation: - -[source,groovy,indent=0] ----- -// for Apache Camel -compile "org.springframework.cloud:spring-cloud-contract-stub-runner-camel:${verifierVersion}" -// for Spring Integration -compile "org.springframework.cloud:spring-cloud-contract-stub-runner-integration:${verifierVersion}" -// for Spring Cloud Stream -compile "org.springframework.cloud:spring-cloud-contract-stub-runner-stream:${verifierVersion}" ----- - -Build a fat-jar and you're ready to go! - -For the properties check the *Stub Runner Spring* section. - -==== Endpoints - -===== HTTP - -- GET `/stubs` - returns a list of all running stubs in `ivy:integer` notation -- GET `/stubs/{ivy}` - returns a port for the given `ivy` notation (when calling the endpoint `ivy` can also be `artifactId` only) - -===== Messaging - -For Messaging - -- GET `/triggers` - returns a list of all running labels in `ivy : [ label1, label2 ...]` notation -- POST `/triggers/{label}` - executes a trigger with `label` -- POST `/triggers/{ivy}/{label}` - executes a trigger with `label` for the given `ivy` notation (when calling the endpoint `ivy` can also be `artifactId` only) - -==== Example - -[source,groovy,indent=0] ----- -include::src/test/groovy/org/springframework/cloud/contract/stubrunner/boot/StubRunnerBootSpec.groovy[tags=boot_usage] ----- \ No newline at end of file diff --git a/spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner-boot/pom.xml b/spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner-boot/pom.xml deleted file mode 100644 index 2c9fe3dec6..0000000000 --- a/spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner-boot/pom.xml +++ /dev/null @@ -1,73 +0,0 @@ - - - 4.0.0 - - org.springframework.cloud - spring-cloud-contract-stub-runner-build - 1.0.0.BUILD-SNAPSHOT - .. - - spring-cloud-contract-stub-runner-boot - jar - Spring Cloud Contract Stub Runner Boot - Spring Cloud Contract Stub Runner Boot - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.cloud - spring-cloud-stream - true - - - org.springframework.cloud - spring-cloud-contract-stub-runner - - - org.springframework.cloud - spring-cloud-contract-wiremock - - - org.spockframework - spock-spring - test - - - com.jayway.restassured - spring-mock-mvc - test - - - org.springframework.cloud - spring-cloud-stream-test-support - - - org.springframework.boot - spring-boot-starter-test - test - - - info.solidsoft.spock - spock-global-unroll - test - - - - - - org.codehaus.gmavenplus - gmavenplus-plugin - - - - testCompile - - - - - - - diff --git a/spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner-boot/src/main/resources/META-INF/spring.factories b/spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner-boot/src/main/resources/META-INF/spring.factories deleted file mode 100644 index 31aea03047..0000000000 --- a/spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner-boot/src/main/resources/META-INF/spring.factories +++ /dev/null @@ -1,3 +0,0 @@ -# Auto Configuration -org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ -org.springframework.cloud.contract.stubrunner.spring.StubRunnerConfiguration diff --git a/spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner-boot/src/test/resources/application.yml b/spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner-boot/src/test/resources/application.yml deleted file mode 100644 index b3b56d9188..0000000000 --- a/spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner-boot/src/test/resources/application.yml +++ /dev/null @@ -1,2 +0,0 @@ -stubrunner.stubs.repository.root: classpath:m2repo/repository/ -stubrunner.stubs.ids: org.springframework.cloud.contract.verifier.stubs:bootService \ No newline at end of file diff --git a/spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner/README.adoc b/spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner/README.adoc index 0b10e95d47..27c13db391 100644 --- a/spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner/README.adoc +++ b/spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner/README.adoc @@ -177,4 +177,59 @@ or `DiscoveryClient` directly, to call those stubbed servers instead of calling You can match the artifactId of the stub with the name of your app by using the `stubrunner.stubs.idsToServiceIds:` map. You can disable Stub Runner Ribbon support by providing: `stubrunner.cloud.ribbon.enabled` equal to `false` -You can disable Stub Runner support by providing: `stubrunner.cloud.enabled` equal to `false` \ No newline at end of file +You can disable Stub Runner support by providing: `stubrunner.cloud.enabled` equal to `false` + +=== Stub Runner Boot + +Spring Cloud Contract Verifier Stub Runner Boot is a Spring Boot application that exposes REST endpoints to +trigger the messaging labels and to access started WireMock servers. + +One of the usecases is to run some smoke (end to end) tests on a deployed application. You can read + more about this in the http://toomuchcoding.com/blog/2015/09/27/microservice-deployment/["Microservice Deployment" article at Too Much Coding blog.] + +==== How to use it? + +Just add the + +[source,groovy,indent=0] +---- +compile "org.springframework.cloud:stub-runner" +---- + +and (optionally) a messaging implementation: + +[source,groovy,indent=0] +---- +// for Apache Camel +compile "org.springframework.cloud:spring-cloud-contract-stub-runner-camel" +// for Spring Integration +compile "org.springframework.cloud:spring-cloud-contract-stub-runner-integration" +// for Spring Cloud Stream +compile "org.springframework.cloud:spring-cloud-contract-stub-runner-stream" +---- + +Build a fat-jar with `@EnableStubRunnerServer` and you're ready to go! + +For the properties check the *Stub Runner Spring* section. + +==== Endpoints + +===== HTTP + +- GET `/stubs` - returns a list of all running stubs in `ivy:integer` notation +- GET `/stubs/{ivy}` - returns a port for the given `ivy` notation (when calling the endpoint `ivy` can also be `artifactId` only) + +===== Messaging + +For Messaging + +- GET `/triggers` - returns a list of all running labels in `ivy : [ label1, label2 ...]` notation +- POST `/triggers/{label}` - executes a trigger with `label` +- POST `/triggers/{ivy}/{label}` - executes a trigger with `label` for the given `ivy` notation (when calling the endpoint `ivy` can also be `artifactId` only) + +==== Example + +[source,groovy,indent=0] +---- +include::src/test/groovy/org/springframework/cloud/contract/stubrunner/boot/StubRunnerBootSpec.groovy[tags=boot_usage] +---- \ No newline at end of file diff --git a/spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner/pom.xml b/spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner/pom.xml index c4976bf1a1..4bb8982043 100644 --- a/spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner/pom.xml +++ b/spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner/pom.xml @@ -81,6 +81,11 @@ cglib test + + com.jayway.restassured + spring-mock-mvc + test + org.spockframework spock-spring diff --git a/spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner/src/main/java/org/springframework/cloud/contract/stubrunner/server/EnableStubRunnerServer.java b/spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner/src/main/java/org/springframework/cloud/contract/stubrunner/server/EnableStubRunnerServer.java new file mode 100644 index 0000000000..e6088c3e3a --- /dev/null +++ b/spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner/src/main/java/org/springframework/cloud/contract/stubrunner/server/EnableStubRunnerServer.java @@ -0,0 +1,44 @@ +/* + * Copyright 2012-2015 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.cloud.contract.stubrunner.server; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Inherited; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +import org.springframework.cloud.contract.stubrunner.spring.StubRunnerConfiguration; +import org.springframework.context.annotation.Import; + +/** + * @author Dave Syer + * + */ +/** + * Annotation to enable a Stub runner server. + * @author Spencer Gibb + */ +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +@Documented +@Inherited +@Import({HttpStubsController.class, TriggerController.class, StubRunnerConfiguration.class}) +public @interface EnableStubRunnerServer { + +} diff --git a/spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner-boot/src/main/java/org/springframework/cloud/contract/stubrunner/boot/HttpStubsController.java b/spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner/src/main/java/org/springframework/cloud/contract/stubrunner/server/HttpStubsController.java similarity index 96% rename from spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner-boot/src/main/java/org/springframework/cloud/contract/stubrunner/boot/HttpStubsController.java rename to spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner/src/main/java/org/springframework/cloud/contract/stubrunner/server/HttpStubsController.java index 0282cb3249..2d5eaa1e70 100644 --- a/spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner-boot/src/main/java/org/springframework/cloud/contract/stubrunner/boot/HttpStubsController.java +++ b/spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner/src/main/java/org/springframework/cloud/contract/stubrunner/server/HttpStubsController.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.cloud.contract.stubrunner.boot; +package org.springframework.cloud.contract.stubrunner.server; import java.util.Map; diff --git a/spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner-boot/src/main/java/org/springframework/cloud/contract/stubrunner/boot/StubRunnerBoot.java b/spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner/src/main/java/org/springframework/cloud/contract/stubrunner/server/StubRunnerBackupAutoConfiguration.java similarity index 73% rename from spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner-boot/src/main/java/org/springframework/cloud/contract/stubrunner/boot/StubRunnerBoot.java rename to spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner/src/main/java/org/springframework/cloud/contract/stubrunner/server/StubRunnerBackupAutoConfiguration.java index 76b86460c3..c04aad6482 100644 --- a/spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner-boot/src/main/java/org/springframework/cloud/contract/stubrunner/boot/StubRunnerBoot.java +++ b/spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner/src/main/java/org/springframework/cloud/contract/stubrunner/server/StubRunnerBackupAutoConfiguration.java @@ -14,29 +14,21 @@ * limitations under the License. */ -package org.springframework.cloud.contract.stubrunner.boot; +package org.springframework.cloud.contract.stubrunner.server; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.AutoConfigureAfter; -import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; -import org.springframework.cloud.contract.stubrunner.spring.StubRunnerConfiguration; import org.springframework.cloud.contract.verifier.messaging.ContractVerifierMessageBuilder; import org.springframework.cloud.contract.verifier.messaging.ContractVerifierMessaging; import org.springframework.cloud.contract.verifier.messaging.noop.NoOpContractVerifierMessageBuilder; import org.springframework.cloud.contract.verifier.messaging.noop.NoOpContractVerifierMessaging; import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; /** * @author Marcin Grzejszczak */ -@SpringBootApplication -@AutoConfigureAfter(StubRunnerConfiguration.class) -public class StubRunnerBoot { - - public static void main(String[] args) { - SpringApplication.run(StubRunnerBoot.class, args); - } +@Configuration +public class StubRunnerBackupAutoConfiguration { @Bean @ConditionalOnMissingBean diff --git a/spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner/src/main/java/org/springframework/cloud/contract/stubrunner/server/StubRunnerBoot.java b/spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner/src/main/java/org/springframework/cloud/contract/stubrunner/server/StubRunnerBoot.java new file mode 100644 index 0000000000..86f80031ce --- /dev/null +++ b/spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner/src/main/java/org/springframework/cloud/contract/stubrunner/server/StubRunnerBoot.java @@ -0,0 +1,33 @@ +/* + * Copyright 2013-2016 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.cloud.contract.stubrunner.server; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * @author Marcin Grzejszczak + */ +@SpringBootApplication +@EnableStubRunnerServer +public class StubRunnerBoot { + + public static void main(String[] args) { + SpringApplication.run(StubRunnerBoot.class, args); + } + +} diff --git a/spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner-boot/src/main/java/org/springframework/cloud/contract/stubrunner/boot/TriggerController.java b/spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner/src/main/java/org/springframework/cloud/contract/stubrunner/server/TriggerController.java similarity index 97% rename from spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner-boot/src/main/java/org/springframework/cloud/contract/stubrunner/boot/TriggerController.java rename to spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner/src/main/java/org/springframework/cloud/contract/stubrunner/server/TriggerController.java index ba5aef45f5..e20c0bfce9 100644 --- a/spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner-boot/src/main/java/org/springframework/cloud/contract/stubrunner/boot/TriggerController.java +++ b/spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner/src/main/java/org/springframework/cloud/contract/stubrunner/server/TriggerController.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.cloud.contract.stubrunner.boot; +package org.springframework.cloud.contract.stubrunner.server; import java.util.Collection; import java.util.Collections; diff --git a/spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner/src/main/resources/META-INF/spring.factories b/spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner/src/main/resources/META-INF/spring.factories index acec82308a..58f417a908 100644 --- a/spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner/src/main/resources/META-INF/spring.factories +++ b/spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner/src/main/resources/META-INF/spring.factories @@ -3,3 +3,6 @@ org.springframework.cloud.contract.stubrunner.spring.AutoConfigureStubRunner=\ org.springframework.cloud.contract.stubrunner.spring.StubRunnerConfiguration,\ org.springframework.cloud.contract.stubrunner.spring.cloud.StubRunnerSpringCloudAutoConfiguration,\ org.springframework.cloud.contract.stubrunner.spring.cloud.ribbon.StubRunnerRibbonAutoConfiguration + +org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ +org.springframework.cloud.contract.stubrunner.server.StubRunnerBackupAutoConfiguration diff --git a/spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner-boot/src/test/groovy/org/springframework/cloud/contract/stubrunner/boot/StubRunnerBootSpec.groovy b/spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner/src/test/groovy/org/springframework/cloud/contract/stubrunner/server/StubRunnerBootSpec.groovy similarity index 94% rename from spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner-boot/src/test/groovy/org/springframework/cloud/contract/stubrunner/boot/StubRunnerBootSpec.groovy rename to spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner/src/test/groovy/org/springframework/cloud/contract/stubrunner/server/StubRunnerBootSpec.groovy index 762bf3a1ba..307da54b07 100644 --- a/spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner-boot/src/test/groovy/org/springframework/cloud/contract/stubrunner/boot/StubRunnerBootSpec.groovy +++ b/spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner/src/test/groovy/org/springframework/cloud/contract/stubrunner/server/StubRunnerBootSpec.groovy @@ -14,14 +14,14 @@ * limitations under the License. */ -package org.springframework.cloud.contract.stubrunner.boot +package org.springframework.cloud.contract.stubrunner.server import groovy.json.JsonSlurper import org.springframework.beans.factory.annotation.Autowired +import org.springframework.boot.test.IntegrationTest; import org.springframework.boot.test.context.SpringBootContextLoader import org.springframework.cloud.contract.stubrunner.StubRunning -import org.springframework.cloud.stream.annotation.EnableBinding import org.springframework.context.annotation.Configuration import org.springframework.test.context.ContextConfiguration @@ -33,9 +33,8 @@ import com.jayway.restassured.module.mockmvc.RestAssuredMockMvc * @author Marcin Grzejszczak */ // tag::boot_usage[] -@ContextConfiguration(classes = [StubRunnerBootSpec, StubRunnerBoot], loader = SpringBootContextLoader) -@EnableBinding -@Configuration +@ContextConfiguration(classes = StubRunnerBoot, loader = SpringBootContextLoader) +@IntegrationTest("spring.cloud.zookeeper.enabled=false") class StubRunnerBootSpec extends Specification { @Autowired StubRunning stubRunning diff --git a/spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner/src/test/resources/application.yml b/spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner/src/test/resources/application.yml index 629b688f80..a1a2c866bf 100644 --- a/spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner/src/test/resources/application.yml +++ b/spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner/src/test/resources/application.yml @@ -1,5 +1,5 @@ stubrunner.stubs.repository.root: classpath:m2repo/repository/ -stubrunner.stubs.ids: org.springframework.cloud.contract.verifier.stubs:loanIssuance,org.springframework.cloud.contract.verifier.stubs:fraudDetectionServer +stubrunner.stubs.ids: org.springframework.cloud.contract.verifier.stubs:loanIssuance,org.springframework.cloud.contract.verifier.stubs:fraudDetectionServer,org.springframework.cloud.contract.verifier.stubs:bootService stubrunner.stubs.idsToServiceIds: ivyNotation: someValueInsideYourCode diff --git a/spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner-boot/src/test/resources/m2repo/repository/org/springframework/cloud/contract/verifier/stubs/bootService/0.0.1-SNAPSHOT/bootService-0.0.1-SNAPSHOT-stubs.jar b/spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner/src/test/resources/m2repo/repository/org/springframework/cloud/contract/verifier/stubs/bootService/0.0.1-SNAPSHOT/bootService-0.0.1-SNAPSHOT-stubs.jar similarity index 100% rename from spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner-boot/src/test/resources/m2repo/repository/org/springframework/cloud/contract/verifier/stubs/bootService/0.0.1-SNAPSHOT/bootService-0.0.1-SNAPSHOT-stubs.jar rename to spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner/src/test/resources/m2repo/repository/org/springframework/cloud/contract/verifier/stubs/bootService/0.0.1-SNAPSHOT/bootService-0.0.1-SNAPSHOT-stubs.jar diff --git a/spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner-boot/src/test/resources/m2repo/repository/org/springframework/cloud/contract/verifier/stubs/bootService/0.0.1-SNAPSHOT/bootService-0.0.1-SNAPSHOT.pom b/spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner/src/test/resources/m2repo/repository/org/springframework/cloud/contract/verifier/stubs/bootService/0.0.1-SNAPSHOT/bootService-0.0.1-SNAPSHOT.pom similarity index 100% rename from spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner-boot/src/test/resources/m2repo/repository/org/springframework/cloud/contract/verifier/stubs/bootService/0.0.1-SNAPSHOT/bootService-0.0.1-SNAPSHOT.pom rename to spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner/src/test/resources/m2repo/repository/org/springframework/cloud/contract/verifier/stubs/bootService/0.0.1-SNAPSHOT/bootService-0.0.1-SNAPSHOT.pom diff --git a/spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner-boot/src/test/resources/m2repo/repository/org/springframework/cloud/contract/verifier/stubs/bootService/maven-metadata.xml b/spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner/src/test/resources/m2repo/repository/org/springframework/cloud/contract/verifier/stubs/bootService/maven-metadata.xml similarity index 100% rename from spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner-boot/src/test/resources/m2repo/repository/org/springframework/cloud/contract/verifier/stubs/bootService/maven-metadata.xml rename to spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner/src/test/resources/m2repo/repository/org/springframework/cloud/contract/verifier/stubs/bootService/maven-metadata.xml