From 7cdf36127ed70029ce56808cd999dac69eb560b1 Mon Sep 17 00:00:00 2001 From: Dave Syer Date: Tue, 19 Jul 2016 11:10:32 +0100 Subject: [PATCH] Finish refactoring in tests --- .../contract/stubrunner/StubRunnerExecutorSpec.groovy | 11 ++++------- .../contract/stubrunner/StubRunnerFactorySpec.groovy | 3 ++- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner/src/test/groovy/org/springframework/cloud/contract/stubrunner/StubRunnerExecutorSpec.groovy b/spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner/src/test/groovy/org/springframework/cloud/contract/stubrunner/StubRunnerExecutorSpec.groovy index 8041b5ca40..442b689ee5 100644 --- a/spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner/src/test/groovy/org/springframework/cloud/contract/stubrunner/StubRunnerExecutorSpec.groovy +++ b/spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner/src/test/groovy/org/springframework/cloud/contract/stubrunner/StubRunnerExecutorSpec.groovy @@ -18,13 +18,10 @@ package org.springframework.cloud.contract.stubrunner import groovy.json.JsonOutput -import java.util.Map; -import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeUnit import org.springframework.cloud.contract.stubrunner.util.StubsParser -import org.springframework.cloud.contract.verifier.messaging.StubMessages; -import org.springframework.cloud.contract.verifier.messaging.internal.ContractVerifierMessage; -import org.springframework.cloud.contract.verifier.messaging.internal.ContractVerifierMessaging +import org.springframework.cloud.contract.verifier.messaging.StubMessages import spock.lang.Specification @@ -86,7 +83,7 @@ class StubRunnerExecutorSpec extends Specification { def 'should ensure that triggered contracts have properly parsed message body when a message is sent'() { given: - StubRunnerExecutor executor = new StubRunnerExecutor(portScanner, new AssertingContractVerifierMessaging()) + StubRunnerExecutor executor = new StubRunnerExecutor(portScanner, new AssertingStubMessages()) executor.runStubs(stubRunnerOptions, repository, stub) when: executor.trigger('send_order') @@ -102,7 +99,7 @@ class StubRunnerExecutorSpec extends Specification { } } - private class AssertingContractVerifierMessaging implements ContractVerifierMessageExchange { + private class AssertingStubMessages implements StubMessages { @Override public void send(Object message, String destination) { diff --git a/spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner/src/test/groovy/org/springframework/cloud/contract/stubrunner/StubRunnerFactorySpec.groovy b/spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner/src/test/groovy/org/springframework/cloud/contract/stubrunner/StubRunnerFactorySpec.groovy index 118bce8a73..24776bcf00 100644 --- a/spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner/src/test/groovy/org/springframework/cloud/contract/stubrunner/StubRunnerFactorySpec.groovy +++ b/spring-cloud-contract-stub-runner/spring-cloud-contract-stub-runner/src/test/groovy/org/springframework/cloud/contract/stubrunner/StubRunnerFactorySpec.groovy @@ -19,6 +19,7 @@ package org.springframework.cloud.contract.stubrunner import org.junit.Rule import org.junit.rules.TemporaryFolder import org.springframework.cloud.contract.verifier.messaging.noop.NoOpStubMessages + import spock.lang.Specification class StubRunnerFactorySpec extends Specification { @@ -35,7 +36,7 @@ class StubRunnerFactorySpec extends Specification { stubRunnerOptions = new StubRunnerOptionsBuilder() .withStubRepositoryRoot(folder.root.absolutePath) // FIXME: not used .withStubs(stubs).build() - factory = new StubRunnerFactory(stubRunnerOptions, downloader, new NoOpContractVerifierMessaging()) + factory = new StubRunnerFactory(stubRunnerOptions, downloader, new NoOpStubMessages()) } def "Should download stub definitions many times"() {