diff --git a/spring-cloud-contract-verifier/src/main/java/org/springframework/cloud/contract/verifier/messaging/stream/StreamOutputDestinationMessageReceiver.java b/spring-cloud-contract-verifier/src/main/java/org/springframework/cloud/contract/verifier/messaging/stream/StreamOutputDestinationMessageReceiver.java index 9fdc31a656..5ee8edd50c 100644 --- a/spring-cloud-contract-verifier/src/main/java/org/springframework/cloud/contract/verifier/messaging/stream/StreamOutputDestinationMessageReceiver.java +++ b/spring-cloud-contract-verifier/src/main/java/org/springframework/cloud/contract/verifier/messaging/stream/StreamOutputDestinationMessageReceiver.java @@ -43,8 +43,7 @@ class StreamOutputDestinationMessageReceiver try { OutputDestination outputDestination = this.context .getBean(OutputDestination.class); - return outputDestination.receive(timeUnit.toMillis(timeout), - destination); + return outputDestination.receive(timeUnit.toMillis(timeout), destination); } catch (Exception e) { log.error("Exception occurred while trying to read a message from " diff --git a/spring-cloud-contract-verifier/src/test/groovy/org/springframework/cloud/contract/verifier/messaging/stream/StreamStubMessagesWithDestinationsSpec.groovy b/spring-cloud-contract-verifier/src/test/groovy/org/springframework/cloud/contract/verifier/messaging/stream/StreamStubMessagesWithDestinationsSpec.groovy index 78b2a863d2..105c7e74c2 100644 --- a/spring-cloud-contract-verifier/src/test/groovy/org/springframework/cloud/contract/verifier/messaging/stream/StreamStubMessagesWithDestinationsSpec.groovy +++ b/spring-cloud-contract-verifier/src/test/groovy/org/springframework/cloud/contract/verifier/messaging/stream/StreamStubMessagesWithDestinationsSpec.groovy @@ -42,7 +42,7 @@ class StreamStubMessagesWithDestinationsSpec extends Specification { when: messages.receive("verifications") then: - 1 * output.receive(5000, 0) >> null + 1 * output.receive(5000, 'verifications') >> null } @Issue("694") @@ -59,7 +59,7 @@ class StreamStubMessagesWithDestinationsSpec extends Specification { when: messages.send("foo", [:], "verifications") then: - 1 * input.send(_, 0) + 1 * input.send(_, 'verifications') } def "should resolve channel via destination for send"() { @@ -77,7 +77,7 @@ class StreamStubMessagesWithDestinationsSpec extends Specification { when: messages.send("foo", [:], "verifications") then: - 1 * input.send(_, 0) + 1 * input.send(_, 'verifications') } def "should resolve channel via destination for receive"() { @@ -95,6 +95,6 @@ class StreamStubMessagesWithDestinationsSpec extends Specification { when: messages.receive("verifications") then: - 1 * output.receive(5000, 0) >> null + 1 * output.receive(5000, 'verifications') >> null } } diff --git a/tests/spring-cloud-contract-stub-runner-moco/pom.xml b/tests/spring-cloud-contract-stub-runner-moco/pom.xml index f62c7a34b6..9063d3935d 100644 --- a/tests/spring-cloud-contract-stub-runner-moco/pom.xml +++ b/tests/spring-cloud-contract-stub-runner-moco/pom.xml @@ -67,18 +67,6 @@ spock-global-unroll test - - - org.springframework.cloud - spring-cloud-starter-stream-rabbit - - - org.springframework.cloud - spring-cloud-stream - test-jar - test - test-binder - diff --git a/tests/spring-cloud-contract-stub-runner-moco/src/test/groovy/org/springframework/cloud/contract/stubrunner/provider/moco/MocoHttpServerStubSpec.groovy b/tests/spring-cloud-contract-stub-runner-moco/src/test/groovy/org/springframework/cloud/contract/stubrunner/provider/moco/MocoHttpServerStubSpec.groovy index 0b28fec79b..5b68231c41 100644 --- a/tests/spring-cloud-contract-stub-runner-moco/src/test/groovy/org/springframework/cloud/contract/stubrunner/provider/moco/MocoHttpServerStubSpec.groovy +++ b/tests/spring-cloud-contract-stub-runner-moco/src/test/groovy/org/springframework/cloud/contract/stubrunner/provider/moco/MocoHttpServerStubSpec.groovy @@ -20,18 +20,12 @@ import spock.lang.Specification import org.springframework.beans.factory.annotation.Autowired import org.springframework.boot.autoconfigure.EnableAutoConfiguration -import org.springframework.boot.autoconfigure.ImportAutoConfiguration import org.springframework.boot.test.context.SpringBootContextLoader import org.springframework.boot.test.context.SpringBootTest import org.springframework.cloud.contract.stubrunner.StubFinder import org.springframework.cloud.contract.stubrunner.spring.AutoConfigureStubRunner import org.springframework.cloud.contract.stubrunner.spring.StubRunnerProperties -import org.springframework.cloud.stream.annotation.StreamListener -import org.springframework.cloud.stream.binder.test.TestChannelBinderConfiguration -import org.springframework.cloud.stream.messaging.Sink -import org.springframework.context.annotation.Bean import org.springframework.context.annotation.Configuration -import org.springframework.stereotype.Component import org.springframework.test.context.ActiveProfiles import org.springframework.test.context.ContextConfiguration /** @@ -48,9 +42,6 @@ class MocoHttpServerStubSpec extends Specification { @Autowired StubFinder stubFinder - @Autowired - MyListener myListener - def 'should successfully receive a response from a stub'() { given: String url = stubFinder.findStubUrl('fraudDetectionServerMoco').toString() @@ -62,42 +53,12 @@ class MocoHttpServerStubSpec extends Specification { "${url.toString()}/name2".toURL().text then: thrown(IOException) - when: - stubFinder.trigger("send_order") - then: - myListener.model?.description == "This is the order description" - when: - myListener.model = null - stubFinder.trigger("send_order2") - then: - myListener.model?.description == "This is the order description" } @Configuration @EnableAutoConfiguration - @ImportAutoConfiguration(TestChannelBinderConfiguration.class) static class MocoConfig { - - @Bean - MyListener myListener() { - return new MyListener() - } } - @Component - static class MyListener { - - Model model - - @StreamListener(Sink.INPUT) - void listen(Model data) { - this.model = data - } - } - - static class Model { - String uuid - String description - } } diff --git a/tests/spring-cloud-contract-stub-runner-stream/src/test/groovy/org/springframework/cloud/contract/stubrunner/messaging/stream/StreamStubRunnerSpec.groovy b/tests/spring-cloud-contract-stub-runner-stream/src/test/groovy/org/springframework/cloud/contract/stubrunner/messaging/stream/StreamStubRunnerSpec.groovy index 759d5ecc37..7ad70e5c4a 100644 --- a/tests/spring-cloud-contract-stub-runner-stream/src/test/groovy/org/springframework/cloud/contract/stubrunner/messaging/stream/StreamStubRunnerSpec.groovy +++ b/tests/spring-cloud-contract-stub-runner-stream/src/test/groovy/org/springframework/cloud/contract/stubrunner/messaging/stream/StreamStubRunnerSpec.groovy @@ -37,6 +37,7 @@ import org.springframework.cloud.stream.binder.test.TestChannelBinderConfigurati import org.springframework.context.annotation.Configuration import org.springframework.messaging.Message import org.springframework.test.context.ContextConfiguration + /** * @author Marcin Grzejszczak */ @@ -52,11 +53,6 @@ class StreamStubRunnerSpec extends Specification { @Autowired MessageVerifier> messaging - def setup() { - // ensure that message were taken from the queue - messaging.receive('returnBook', 100, TimeUnit.MILLISECONDS) - } - def 'should download the stub and register a route for it'() { when: // tag::client_send[] @@ -219,10 +215,11 @@ class StreamStubRunnerSpec extends Specification { } // end::sample_dsl_3[] - @ImportAutoConfiguration(TestChannelBinderConfiguration.class) @Configuration @EnableAutoConfiguration - protected static class Config {} + protected static class Config { + + } }