diff --git a/spring-cloud-contract-stub-runner/src/test/groovy/org/springframework/cloud/contract/stubrunner/provider/wiremock/WireMockHttpServerStubAccessor.groovy b/spring-cloud-contract-stub-runner/src/test/groovy/org/springframework/cloud/contract/stubrunner/provider/wiremock/WireMockHttpServerStubAccessor.groovy index 82b3690440..477c6e592c 100644 --- a/spring-cloud-contract-stub-runner/src/test/groovy/org/springframework/cloud/contract/stubrunner/provider/wiremock/WireMockHttpServerStubAccessor.groovy +++ b/spring-cloud-contract-stub-runner/src/test/groovy/org/springframework/cloud/contract/stubrunner/provider/wiremock/WireMockHttpServerStubAccessor.groovy @@ -22,4 +22,8 @@ class WireMockHttpServerStubAccessor { assert WireMockHttpServerStub.SERVERS.every { it.value.random } return true } + + static void clear() { + WireMockHttpServerStub.SERVERS.clear() + } } diff --git a/spring-cloud-contract-stub-runner/src/test/groovy/org/springframework/cloud/contract/stubrunner/spring/StubRunnerConfigurationSpec.groovy b/spring-cloud-contract-stub-runner/src/test/groovy/org/springframework/cloud/contract/stubrunner/spring/StubRunnerConfigurationSpec.groovy index 9016d3a993..754748006d 100644 --- a/spring-cloud-contract-stub-runner/src/test/groovy/org/springframework/cloud/contract/stubrunner/spring/StubRunnerConfigurationSpec.groovy +++ b/spring-cloud-contract-stub-runner/src/test/groovy/org/springframework/cloud/contract/stubrunner/spring/StubRunnerConfigurationSpec.groovy @@ -74,6 +74,7 @@ class StubRunnerConfigurationSpec extends Specification { void setupProps() { System.clearProperty("stubrunner.repository.root") System.clearProperty("stubrunner.classifier") + WireMockHttpServerStubAccessor.clear() } def 'should mark all ports as random'() {