Remove references to old stub runner modules
This commit is contained in:
@@ -46,7 +46,8 @@ dependencies {
|
||||
testCompile "org.spockframework:spock-core"
|
||||
testCompile "org.springframework.boot:spring-boot-starter-test"
|
||||
testCompile "junit:junit"
|
||||
testCompile "org.springframework.cloud:spring-cloud-contract-stub-runner-stream:${project.findProperty('verifierVersion') ?: verifierVersion}"
|
||||
testCompile "org.springframework.cloud:spring-cloud-contract-stub-runner-stream"
|
||||
testCompile "org.springframework.cloud:spring-cloud-contract-wiremock"
|
||||
}
|
||||
|
||||
test {
|
||||
|
||||
@@ -40,6 +40,11 @@
|
||||
<artifactId>spring-cloud-contract-stub-runner-stream</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-contract-wiremock</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<dependencyManagement>
|
||||
|
||||
@@ -46,7 +46,7 @@ dependencies {
|
||||
testCompile "org.spockframework:spock-core"
|
||||
testCompile "junit:junit"
|
||||
testCompile 'org.springframework.cloud:spring-cloud-contract-wiremock'
|
||||
testCompile "org.springframework.cloud:spring-cloud-contract-stub-runner-spring:${findProperty('verifierVersion') ?: verifierVersion}"
|
||||
testCompile "org.springframework.cloud:spring-cloud-contract-stub-runner"
|
||||
}
|
||||
|
||||
test {
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-contract-stub-runner-spring</artifactId>
|
||||
<artifactId>spring-cloud-contract-stub-runner</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
||||
@@ -56,11 +56,6 @@
|
||||
<artifactId>spring-cloud-contract-stub-runner-jetty</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-contract-stub-runner-spring</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-contract-stub-runner-boot</artifactId>
|
||||
|
||||
@@ -24,7 +24,11 @@
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-contract-stub-runner-spring</artifactId>
|
||||
<artifactId>spring-cloud-contract-stub-runner</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-contract-wiremock</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.spockframework</groupId>
|
||||
|
||||
@@ -15,11 +15,12 @@
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-contract-stub-runner-jetty</artifactId>
|
||||
<artifactId>spring-cloud-contract-stub-runner</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-contract-stub-runner-spring</artifactId>
|
||||
<artifactId>spring-cloud-contract-stub-runner-jetty</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
|
||||
@@ -18,11 +18,12 @@
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-contract-stub-runner-jetty</artifactId>
|
||||
<artifactId>spring-cloud-contract-stub-runner</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-contract-stub-runner-spring</artifactId>
|
||||
<artifactId>spring-cloud-contract-stub-runner-jetty</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
@@ -37,10 +38,6 @@
|
||||
<artifactId>junit</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.groovy</groupId>
|
||||
<artifactId>groovy</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.spockframework</groupId>
|
||||
<artifactId>spock-core</artifactId>
|
||||
|
||||
@@ -18,7 +18,12 @@
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-contract-stub-runner-spring</artifactId>
|
||||
<artifactId>spring-cloud-contract-stub-runner</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-contract-stub-runner-jetty</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
@@ -33,10 +38,6 @@
|
||||
<artifactId>junit</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.groovy</groupId>
|
||||
<artifactId>groovy</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.spockframework</groupId>
|
||||
<artifactId>spock-core</artifactId>
|
||||
@@ -52,11 +53,6 @@
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>info.solidsoft.spock</groupId>
|
||||
<artifactId>spock-global-unroll</artifactId>
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* Copyright 2012-2013 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;
|
||||
|
||||
import org.junit.Ignore
|
||||
import org.junit.runner.RunWith
|
||||
import org.junit.runners.Suite
|
||||
import org.junit.runners.Suite.SuiteClasses
|
||||
import org.springframework.cloud.contract.stubrunner.spring.StubRunnerConfigurationSpec
|
||||
import org.springframework.cloud.contract.stubrunner.spring.cloud.StubRunnerSpringCloudAutoConfigurationSpec
|
||||
|
||||
/**
|
||||
* A test suite for probing weird ordering problems in the tests.
|
||||
*
|
||||
* @author Dave Syer
|
||||
*/
|
||||
@RunWith(Suite)
|
||||
@SuiteClasses([
|
||||
StubRunnerSpringCloudAutoConfigurationSpec,
|
||||
StubRunnerConfigurationSpec
|
||||
])
|
||||
@Ignore
|
||||
public class AdhocTestSuite {
|
||||
|
||||
}
|
||||
@@ -36,8 +36,8 @@ public class StubRunnerRuleCustomPortJUnitTest {
|
||||
@BeforeClass
|
||||
@AfterClass
|
||||
public static void setupProps() {
|
||||
System.getProperties().setProperty("stubrunner.stubs.repository.root", "");
|
||||
System.getProperties().setProperty("stubrunner.stubs.classifier", "stubs");
|
||||
System.clearProperty("stubrunner.stubs.repository.root");
|
||||
System.clearProperty("stubrunner.stubs.classifier");
|
||||
}
|
||||
|
||||
// tag::classrule_with_port[]
|
||||
|
||||
@@ -36,8 +36,8 @@ public class StubRunnerRuleJUnitTest {
|
||||
@BeforeClass
|
||||
@AfterClass
|
||||
public static void setupProps() {
|
||||
System.getProperties().setProperty("stubrunner.stubs.repository.root", "");
|
||||
System.getProperties().setProperty("stubrunner.stubs.classifier", "stubs");
|
||||
System.clearProperty("stubrunner.stubs.repository.root");
|
||||
System.clearProperty("stubrunner.stubs.classifier");
|
||||
}
|
||||
|
||||
// tag::classrule[]
|
||||
|
||||
@@ -30,8 +30,8 @@ class StubRunnerRuleSpec extends Specification {
|
||||
@BeforeClass
|
||||
@AfterClass
|
||||
void setupProps() {
|
||||
System.getProperties().setProperty("stubrunner.stubs.repository.root", "");
|
||||
System.getProperties().setProperty("stubrunner.stubs.classifier", "stubs");
|
||||
System.clearProperty("stubrunner.stubs.repository.root");
|
||||
System.clearProperty("stubrunner.stubs.classifier");
|
||||
}
|
||||
|
||||
// tag::classrule[]
|
||||
|
||||
@@ -16,12 +16,15 @@
|
||||
|
||||
package org.springframework.cloud.contract.stubrunner.spring
|
||||
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.BeforeClass;
|
||||
import org.springframework.beans.factory.annotation.Autowired
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration
|
||||
import org.springframework.boot.test.IntegrationTest;
|
||||
import org.springframework.boot.test.context.SpringBootContextLoader
|
||||
import org.springframework.cloud.contract.stubrunner.StubFinder
|
||||
import org.springframework.context.annotation.Configuration
|
||||
import org.springframework.test.annotation.DirtiesContext
|
||||
import org.springframework.test.context.ContextConfiguration
|
||||
|
||||
import spock.lang.Specification
|
||||
@@ -31,11 +34,21 @@ import spock.lang.Specification
|
||||
*/
|
||||
// tag::test[]
|
||||
@ContextConfiguration(classes = Config, loader = SpringBootContextLoader)
|
||||
// Not necessary if Spring Cloud is used. TODO: make it work without this.
|
||||
@IntegrationTest("stubrunner.cloud.enabled=false")
|
||||
@AutoConfigureStubRunner
|
||||
@DirtiesContext
|
||||
class StubRunnerConfigurationSpec extends Specification {
|
||||
|
||||
@Autowired StubFinder stubFinder
|
||||
|
||||
@BeforeClass
|
||||
@AfterClass
|
||||
void setupProps() {
|
||||
System.clearProperty("stubrunner.stubs.repository.root");
|
||||
System.clearProperty("stubrunner.stubs.classifier");
|
||||
}
|
||||
|
||||
def 'should start WireMock servers'() {
|
||||
expect: 'WireMocks are running'
|
||||
stubFinder.findStubUrl('org.springframework.cloud.contract.verifier.stubs', 'loanIssuance') != null
|
||||
|
||||
@@ -19,6 +19,8 @@ package org.springframework.cloud.contract.stubrunner.spring.cloud
|
||||
import groovy.util.logging.Slf4j
|
||||
|
||||
import org.apache.curator.test.TestingServer
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.BeforeClass;
|
||||
import org.springframework.beans.factory.annotation.Autowired
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration
|
||||
import org.springframework.boot.test.IntegrationTest
|
||||
@@ -33,6 +35,7 @@ import org.springframework.cloud.zookeeper.discovery.ZookeeperServiceDiscovery
|
||||
import org.springframework.context.ConfigurableApplicationContext
|
||||
import org.springframework.context.annotation.Bean
|
||||
import org.springframework.context.annotation.Configuration
|
||||
import org.springframework.test.annotation.DirtiesContext
|
||||
import org.springframework.test.context.ContextConfiguration
|
||||
import org.springframework.util.SocketUtils
|
||||
import org.springframework.web.client.RestTemplate
|
||||
@@ -44,8 +47,10 @@ import spock.lang.Specification
|
||||
*/
|
||||
@ContextConfiguration(classes = Config, loader = SpringBootContextLoader)
|
||||
@WebIntegrationTest(randomPort = true)
|
||||
@IntegrationTest
|
||||
@Slf4j
|
||||
@AutoConfigureStubRunner
|
||||
@DirtiesContext
|
||||
class StubRunnerSpringCloudAutoConfigurationSpec extends Specification {
|
||||
|
||||
@Autowired StubFinder stubFinder
|
||||
@@ -54,6 +59,13 @@ class StubRunnerSpringCloudAutoConfigurationSpec extends Specification {
|
||||
@Autowired ZookeeperServiceDiscovery zookeeperServiceDiscovery
|
||||
@Autowired ConfigurableApplicationContext applicationContext
|
||||
|
||||
@BeforeClass
|
||||
@AfterClass
|
||||
void setupProps() {
|
||||
System.clearProperty("stubrunner.stubs.repository.root");
|
||||
System.clearProperty("stubrunner.stubs.classifier");
|
||||
}
|
||||
|
||||
def 'should make service discovery work'() {
|
||||
expect: 'WireMocks are running'
|
||||
"${stubFinder.findStubUrl('loanIssuance').toString()}/name".toURL().text == 'loanIssuance'
|
||||
|
||||
Reference in New Issue
Block a user