Bumped Boot in gradle samples
This commit is contained in:
@@ -7,7 +7,7 @@ buildscript {
|
||||
maven { url "https://repo.spring.io/release" }
|
||||
}
|
||||
dependencies {
|
||||
classpath "org.springframework.boot:spring-boot-gradle-plugin:2.1.2.RELEASE"
|
||||
classpath "org.springframework.boot:spring-boot-gradle-plugin:${findProperty('bootVersion') ?: bootVersion}"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
org.gradle.daemon=false
|
||||
BOM_VERSION=Hoxton.BUILD-SNAPSHOT
|
||||
BOM_VERSION=Hoxton.BUILD-SNAPSHOT
|
||||
bootVersion=2.2.0.BUILD-SNAPSHOT
|
||||
@@ -9,7 +9,7 @@ buildscript {
|
||||
}
|
||||
// end::repos[]
|
||||
dependencies {
|
||||
classpath "org.springframework.boot:spring-boot-gradle-plugin:2.1.2.RELEASE"
|
||||
classpath "org.springframework.boot:spring-boot-gradle-plugin:${findProperty('bootVersion') ?: bootVersion}"
|
||||
classpath "org.springframework.cloud:spring-cloud-contract-gradle-plugin:${findProperty('verifierVersion') ?: verifierVersion}"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
org.gradle.daemon=false
|
||||
verifierVersion=2.2.0.BUILD-SNAPSHOT
|
||||
BOM_VERSION=Hoxton.BUILD-SNAPSHOT
|
||||
BOM_VERSION=Hoxton.BUILD-SNAPSHOT
|
||||
bootVersion=2.2.0.BUILD-SNAPSHOT
|
||||
@@ -7,7 +7,7 @@ buildscript {
|
||||
maven { url "https://repo.spring.io/release" }
|
||||
}
|
||||
dependencies {
|
||||
classpath "org.springframework.boot:spring-boot-gradle-plugin:2.1.2.RELEASE"
|
||||
classpath "org.springframework.boot:spring-boot-gradle-plugin:${findProperty('bootVersion') ?: bootVersion}"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
org.gradle.daemon=false
|
||||
verifierVersion=2.2.0.BUILD-SNAPSHOT
|
||||
BOM_VERSION=Hoxton.BUILD-SNAPSHOT
|
||||
BOM_VERSION=Hoxton.BUILD-SNAPSHOT
|
||||
bootVersion=2.2.0.BUILD-SNAPSHOT
|
||||
@@ -7,7 +7,7 @@ buildscript {
|
||||
maven { url "https://repo.spring.io/release" }
|
||||
}
|
||||
dependencies {
|
||||
classpath "org.springframework.boot:spring-boot-gradle-plugin:2.1.2.RELEASE"
|
||||
classpath "org.springframework.boot:spring-boot-gradle-plugin:${findProperty('bootVersion') ?: bootVersion}"
|
||||
classpath "org.springframework.cloud:spring-cloud-contract-gradle-plugin:${findProperty('verifierVersion') ?: verifierVersion}"
|
||||
// Example of using Rest Assured 3.x. If you don't add this section Rest Assured 2.9.0 will be used
|
||||
// classpath "com.jayway.restassured:rest-assured:2.9.0"
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
org.gradle.daemon=false
|
||||
verifierVersion=2.2.0.BUILD-SNAPSHOT
|
||||
BOM_VERSION=Hoxton.BUILD-SNAPSHOT
|
||||
BOM_VERSION=Hoxton.BUILD-SNAPSHOT
|
||||
bootVersion=2.2.0.BUILD-SNAPSHOT
|
||||
@@ -7,7 +7,7 @@ buildscript {
|
||||
maven { url "https://repo.spring.io/release" }
|
||||
}
|
||||
dependencies {
|
||||
classpath "org.springframework.boot:spring-boot-gradle-plugin:2.1.2.RELEASE"
|
||||
classpath "org.springframework.boot:spring-boot-gradle-plugin:${findProperty('bootVersion') ?: bootVersion}"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
org.gradle.daemon=false
|
||||
BOM_VERSION=Hoxton.BUILD-SNAPSHOT
|
||||
BOM_VERSION=Hoxton.BUILD-SNAPSHOT
|
||||
bootVersion=2.2.0.BUILD-SNAPSHOT
|
||||
@@ -7,7 +7,7 @@ buildscript {
|
||||
maven { url "https://repo.spring.io/release" }
|
||||
}
|
||||
dependencies {
|
||||
classpath "org.springframework.boot:spring-boot-gradle-plugin:2.1.2.RELEASE"
|
||||
classpath "org.springframework.boot:spring-boot-gradle-plugin:${findProperty('bootVersion') ?: bootVersion}"
|
||||
classpath "org.springframework.cloud:spring-cloud-contract-gradle-plugin:${findProperty('verifierVersion') ?: verifierVersion}"
|
||||
//tag::pact_dependency[]
|
||||
classpath "org.springframework.cloud:spring-cloud-contract-pact:${findProperty('verifierVersion') ?: verifierVersion}"
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
org.gradle.daemon=false
|
||||
verifierVersion=2.2.0.BUILD-SNAPSHOT
|
||||
BOM_VERSION=Hoxton.BUILD-SNAPSHOT
|
||||
BOM_VERSION=Hoxton.BUILD-SNAPSHOT
|
||||
bootVersion=2.2.0.BUILD-SNAPSHOT
|
||||
@@ -7,7 +7,7 @@ buildscript {
|
||||
maven { url "https://repo.spring.io/release" }
|
||||
}
|
||||
dependencies {
|
||||
classpath "org.springframework.boot:spring-boot-gradle-plugin:2.1.2.RELEASE"
|
||||
classpath "org.springframework.boot:spring-boot-gradle-plugin:${findProperty('bootVersion') ?: bootVersion}"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
org.gradle.daemon=false
|
||||
verifierVersion=2.2.0.BUILD-SNAPSHOT
|
||||
BOM_VERSION=Hoxton.BUILD-SNAPSHOT
|
||||
BOM_VERSION=Hoxton.BUILD-SNAPSHOT
|
||||
bootVersion=2.2.0.BUILD-SNAPSHOT
|
||||
@@ -10,7 +10,7 @@ buildscript {
|
||||
maven { url "https://repo.spring.io/plugins-staging-local/" }
|
||||
}
|
||||
dependencies {
|
||||
classpath "org.springframework.boot:spring-boot-gradle-plugin:2.1.2.RELEASE"
|
||||
classpath "org.springframework.boot:spring-boot-gradle-plugin:${findProperty('bootVersion') ?: bootVersion}"
|
||||
classpath "org.springframework.cloud:spring-cloud-contract-gradle-plugin:${project.findProperty('verifierVersion') ?: verifierVersion}"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
org.gradle.daemon=false
|
||||
verifierVersion=2.2.0.BUILD-SNAPSHOT
|
||||
BOM_VERSION=Hoxton.BUILD-SNAPSHOT
|
||||
BOM_VERSION=Hoxton.BUILD-SNAPSHOT
|
||||
bootVersion=2.2.0.BUILD-SNAPSHOT
|
||||
@@ -7,7 +7,7 @@ buildscript {
|
||||
maven { url "https://repo.spring.io/release" }
|
||||
}
|
||||
dependencies {
|
||||
classpath "org.springframework.boot:spring-boot-gradle-plugin:2.1.2.RELEASE"
|
||||
classpath "org.springframework.boot:spring-boot-gradle-plugin:${findProperty('bootVersion') ?: bootVersion}"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
org.gradle.daemon=false
|
||||
verifierVersion=2.2.0.BUILD-SNAPSHOT
|
||||
BOM_VERSION=Hoxton.BUILD-SNAPSHOT
|
||||
BOM_VERSION=Hoxton.BUILD-SNAPSHOT
|
||||
bootVersion=2.2.0.BUILD-SNAPSHOT
|
||||
@@ -10,7 +10,7 @@ buildscript {
|
||||
maven { url "https://repo.spring.io/plugins-staging-local/" }
|
||||
}
|
||||
dependencies {
|
||||
classpath "org.springframework.boot:spring-boot-gradle-plugin:2.1.2.RELEASE"
|
||||
classpath "org.springframework.boot:spring-boot-gradle-plugin:${findProperty('bootVersion') ?: bootVersion}"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
org.gradle.daemon=false
|
||||
verifierVersion=2.2.0.BUILD-SNAPSHOT
|
||||
BOM_VERSION=Hoxton.BUILD-SNAPSHOT
|
||||
BOM_VERSION=Hoxton.BUILD-SNAPSHOT
|
||||
bootVersion=2.2.0.BUILD-SNAPSHOT
|
||||
@@ -7,7 +7,7 @@ buildscript {
|
||||
maven { url "https://repo.spring.io/release" }
|
||||
}
|
||||
dependencies {
|
||||
classpath "org.springframework.boot:spring-boot-gradle-plugin:2.1.2.RELEASE"
|
||||
classpath "org.springframework.boot:spring-boot-gradle-plugin:${findProperty('bootVersion') ?: bootVersion}"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
org.gradle.daemon=false
|
||||
BOM_VERSION=Hoxton.BUILD-SNAPSHOT
|
||||
bootVersion=2.2.0.BUILD-SNAPSHOT
|
||||
|
||||
@@ -9,7 +9,7 @@ buildscript {
|
||||
}
|
||||
// end::repos[]
|
||||
dependencies {
|
||||
classpath "org.springframework.boot:spring-boot-gradle-plugin:2.1.2.RELEASE"
|
||||
classpath "org.springframework.boot:spring-boot-gradle-plugin:${findProperty('bootVersion') ?: bootVersion}"
|
||||
classpath "org.springframework.cloud:spring-cloud-contract-gradle-plugin:${findProperty('verifierVersion') ?: verifierVersion}"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
org.gradle.daemon=false
|
||||
verifierVersion=2.2.0.BUILD-SNAPSHOT
|
||||
BOM_VERSION=Hoxton.BUILD-SNAPSHOT
|
||||
bootVersion=2.2.0.BUILD-SNAPSHOT
|
||||
|
||||
@@ -46,7 +46,8 @@ import org.springframework.util.StringUtils;
|
||||
*/
|
||||
@Configuration
|
||||
@ConditionalOnClass(RoutesBuilder.class)
|
||||
@ConditionalOnProperty(name = "stubrunner.camel.enabled", havingValue = "true", matchIfMissing = true)
|
||||
@ConditionalOnProperty(name = "stubrunner.camel.enabled", havingValue = "true",
|
||||
matchIfMissing = true)
|
||||
public class StubRunnerCamelConfiguration {
|
||||
|
||||
static final String STUBRUNNER_DESTINATION_URL_HEADER_NAME = "STUBRUNNER_DESTINATION_URL";
|
||||
|
||||
@@ -50,7 +50,8 @@ import org.springframework.util.StringUtils;
|
||||
*/
|
||||
@Configuration
|
||||
@ConditionalOnClass(IntegrationFlowBuilder.class)
|
||||
@ConditionalOnProperty(name = "stubrunner.integration.enabled", havingValue = "true", matchIfMissing = true)
|
||||
@ConditionalOnProperty(name = "stubrunner.integration.enabled", havingValue = "true",
|
||||
matchIfMissing = true)
|
||||
public class StubRunnerIntegrationConfiguration {
|
||||
|
||||
@Bean
|
||||
|
||||
@@ -60,7 +60,8 @@ import org.springframework.util.StringUtils;
|
||||
*/
|
||||
@Configuration
|
||||
@ConditionalOnClass({ IntegrationFlows.class, EnableBinding.class })
|
||||
@ConditionalOnProperty(name = "stubrunner.stream.enabled", havingValue = "true", matchIfMissing = true)
|
||||
@ConditionalOnProperty(name = "stubrunner.stream.enabled", havingValue = "true",
|
||||
matchIfMissing = true)
|
||||
@AutoConfigureBefore(StubRunnerIntegrationConfiguration.class)
|
||||
public class StubRunnerStreamConfiguration {
|
||||
|
||||
|
||||
@@ -48,7 +48,8 @@ import org.springframework.util.StringUtils;
|
||||
*/
|
||||
@Configuration
|
||||
@EnableConfigurationProperties(StubRunnerProperties.class)
|
||||
@ConditionalOnMissingBean(type = "org.springframework.cloud.contract.wiremock.WiremockServerConfiguration")
|
||||
@ConditionalOnMissingBean(
|
||||
type = "org.springframework.cloud.contract.wiremock.WiremockServerConfiguration")
|
||||
@Import(StubRunnerPortBeanPostProcessor.class)
|
||||
public class StubRunnerConfiguration {
|
||||
|
||||
|
||||
@@ -34,7 +34,8 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target({ ElementType.TYPE, ElementType.METHOD })
|
||||
@Documented
|
||||
@ConditionalOnProperty(value = "stubrunner.cloud.stubbed.discovery.enabled", havingValue = "false")
|
||||
@ConditionalOnProperty(value = "stubrunner.cloud.stubbed.discovery.enabled",
|
||||
havingValue = "false")
|
||||
public @interface ConditionalOnStubbedDiscoveryDisabled {
|
||||
|
||||
}
|
||||
|
||||
@@ -35,7 +35,8 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target({ ElementType.TYPE, ElementType.METHOD })
|
||||
@Documented
|
||||
@ConditionalOnProperty(value = "stubrunner.cloud.stubbed.discovery.enabled", havingValue = "true", matchIfMissing = true)
|
||||
@ConditionalOnProperty(value = "stubrunner.cloud.stubbed.discovery.enabled",
|
||||
havingValue = "true", matchIfMissing = true)
|
||||
public @interface ConditionalOnStubbedDiscoveryEnabled {
|
||||
|
||||
}
|
||||
|
||||
@@ -55,7 +55,8 @@ public class StubRunnerSpringCloudAutoConfiguration {
|
||||
@Bean
|
||||
@ConditionalOnMissingBean(DiscoveryClient.class)
|
||||
@ConditionalOnStubbedDiscoveryEnabled
|
||||
@ConditionalOnProperty(value = "stubrunner.cloud.delegate.enabled", havingValue = "false", matchIfMissing = true)
|
||||
@ConditionalOnProperty(value = "stubrunner.cloud.delegate.enabled",
|
||||
havingValue = "false", matchIfMissing = true)
|
||||
public DiscoveryClient noOpStubRunnerDiscoveryClient(StubFinder stubFinder,
|
||||
StubMapperProperties stubMapperProperties,
|
||||
@Value("${spring.application.name:unknown}") String springAppName) {
|
||||
|
||||
@@ -34,7 +34,8 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target({ ElementType.TYPE, ElementType.METHOD })
|
||||
@Documented
|
||||
@ConditionalOnProperty(value = "eureka.client.enabled", havingValue = "true", matchIfMissing = true)
|
||||
@ConditionalOnProperty(value = "eureka.client.enabled", havingValue = "true",
|
||||
matchIfMissing = true)
|
||||
@interface ConditionalOnEurekaEnabled {
|
||||
|
||||
}
|
||||
|
||||
@@ -44,7 +44,8 @@ import org.springframework.context.annotation.Configuration;
|
||||
@ConditionalOnClass(org.apache.curator.x.discovery.ServiceInstance.class)
|
||||
@ConditionalOnStubbedDiscoveryDisabled
|
||||
@ConditionalOnZookeeperDiscoveryEnabled
|
||||
@ConditionalOnProperty(value = "stubrunner.cloud.zookeeper.enabled", matchIfMissing = true)
|
||||
@ConditionalOnProperty(value = "stubrunner.cloud.zookeeper.enabled",
|
||||
matchIfMissing = true)
|
||||
public class StubRunnerSpringCloudZookeeperAutoConfiguration {
|
||||
|
||||
@Bean(initMethod = "registerStubs")
|
||||
|
||||
@@ -40,8 +40,9 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
@WebMvcTest
|
||||
@AutoConfigureStubRunner(ids = {
|
||||
"org.springframework.cloud.contract.verifier.stubs:loanIssuance:+:stubs",
|
||||
"org.springframework.cloud.contract.verifier.stubs:fraudDetectionServer:+:stubs" }, minPort = 10001, maxPort = 10020, mappingsOutputFolder = "target/outputmappings/", properties = {
|
||||
"hello=world", "foo=bar" })
|
||||
"org.springframework.cloud.contract.verifier.stubs:fraudDetectionServer:+:stubs" },
|
||||
minPort = 10001, maxPort = 10020, mappingsOutputFolder = "target/outputmappings/",
|
||||
properties = { "hello=world", "foo=bar" })
|
||||
@ActiveProfiles("test")
|
||||
public class StubRunnerSliceTests {
|
||||
|
||||
|
||||
@@ -48,7 +48,8 @@ import org.springframework.cloud.contract.verifier.converter.ToYamlConverter;
|
||||
*
|
||||
* @author Mariusz Smykula
|
||||
*/
|
||||
@Mojo(name = "convert", requiresProject = false, defaultPhase = LifecyclePhase.PROCESS_TEST_RESOURCES)
|
||||
@Mojo(name = "convert", requiresProject = false,
|
||||
defaultPhase = LifecyclePhase.PROCESS_TEST_RESOURCES)
|
||||
public class ConvertMojo extends AbstractMojo {
|
||||
|
||||
static final String DEFAULT_STUBS_DIR = "${project.build.directory}/stubs/";
|
||||
@@ -65,7 +66,8 @@ public class ConvertMojo extends AbstractMojo {
|
||||
* Directory containing Spring Cloud Contract Verifier contracts written using the
|
||||
* GroovyDSL.
|
||||
*/
|
||||
@Parameter(property = "spring.cloud.contract.verifier.contractsDirectory", defaultValue = "${project.basedir}/src/test/resources/contracts")
|
||||
@Parameter(property = "spring.cloud.contract.verifier.contractsDirectory",
|
||||
defaultValue = "${project.basedir}/src/test/resources/contracts")
|
||||
private File contractsDirectory;
|
||||
|
||||
/**
|
||||
|
||||
@@ -39,13 +39,16 @@ import org.codehaus.plexus.archiver.jar.JarArchiver;
|
||||
*
|
||||
* @author Mariusz Smykula
|
||||
*/
|
||||
@Mojo(name = "generateStubs", defaultPhase = LifecyclePhase.PACKAGE, requiresProject = true)
|
||||
@Mojo(name = "generateStubs", defaultPhase = LifecyclePhase.PACKAGE,
|
||||
requiresProject = true)
|
||||
public class GenerateStubsMojo extends AbstractMojo {
|
||||
|
||||
@Parameter(defaultValue = "${project.build.directory}", readonly = true, required = true)
|
||||
@Parameter(defaultValue = "${project.build.directory}", readonly = true,
|
||||
required = true)
|
||||
private File projectBuildDirectory;
|
||||
|
||||
@Parameter(property = "stubsDirectory", defaultValue = "${project.build.directory}/stubs")
|
||||
@Parameter(property = "stubsDirectory",
|
||||
defaultValue = "${project.build.directory}/stubs")
|
||||
private File outputDirectory;
|
||||
|
||||
/**
|
||||
@@ -57,7 +60,8 @@ public class GenerateStubsMojo extends AbstractMojo {
|
||||
/**
|
||||
* Set this to "true" to bypass only JAR creation.
|
||||
*/
|
||||
@Parameter(property = "spring.cloud.contract.verifier.jar.skip", defaultValue = "false")
|
||||
@Parameter(property = "spring.cloud.contract.verifier.jar.skip",
|
||||
defaultValue = "false")
|
||||
private boolean jarSkip;
|
||||
|
||||
@Component
|
||||
|
||||
@@ -49,7 +49,8 @@ import org.springframework.cloud.contract.verifier.config.TestMode;
|
||||
*
|
||||
* @author Mariusz Smykula
|
||||
*/
|
||||
@Mojo(name = "generateTests", defaultPhase = LifecyclePhase.GENERATE_TEST_SOURCES, requiresDependencyResolution = ResolutionScope.TEST)
|
||||
@Mojo(name = "generateTests", defaultPhase = LifecyclePhase.GENERATE_TEST_SOURCES,
|
||||
requiresDependencyResolution = ResolutionScope.TEST)
|
||||
public class GenerateTestsMojo extends AbstractMojo {
|
||||
|
||||
private final AetherStubDownloaderFactory aetherStubDownloaderFactory;
|
||||
@@ -57,13 +58,16 @@ public class GenerateTestsMojo extends AbstractMojo {
|
||||
@Parameter(defaultValue = "${repositorySystemSession}", readonly = true)
|
||||
private RepositorySystemSession repoSession;
|
||||
|
||||
@Parameter(property = "spring.cloud.contract.verifier.contractsDirectory", defaultValue = "${project.basedir}/src/test/resources/contracts")
|
||||
@Parameter(property = "spring.cloud.contract.verifier.contractsDirectory",
|
||||
defaultValue = "${project.basedir}/src/test/resources/contracts")
|
||||
private File contractsDirectory;
|
||||
|
||||
@Parameter(defaultValue = "${project.build.directory}/generated-test-sources/contracts")
|
||||
@Parameter(
|
||||
defaultValue = "${project.build.directory}/generated-test-sources/contracts")
|
||||
private File generatedTestSourcesDir;
|
||||
|
||||
@Parameter(defaultValue = "${project.build.directory}/generated-test-resources/contracts")
|
||||
@Parameter(
|
||||
defaultValue = "${project.build.directory}/generated-test-resources/contracts")
|
||||
private File generatedTestResourcesDir;
|
||||
|
||||
@Parameter
|
||||
@@ -112,7 +116,8 @@ public class GenerateTestsMojo extends AbstractMojo {
|
||||
* Incubating feature. You can check the size of JSON arrays. If not turned on
|
||||
* explicitly will be disabled.
|
||||
*/
|
||||
@Parameter(property = "spring.cloud.contract.verifier.assert.size", defaultValue = "false")
|
||||
@Parameter(property = "spring.cloud.contract.verifier.assert.size",
|
||||
defaultValue = "false")
|
||||
private boolean assertJsonSize;
|
||||
|
||||
/**
|
||||
|
||||
@@ -41,10 +41,12 @@ import org.springframework.util.StringUtils;
|
||||
@Mojo(name = "pushStubsToScm")
|
||||
public class PushStubsToScmMojo extends AbstractMojo {
|
||||
|
||||
@Parameter(defaultValue = "${project.build.directory}", readonly = true, required = true)
|
||||
@Parameter(defaultValue = "${project.build.directory}", readonly = true,
|
||||
required = true)
|
||||
private File projectBuildDirectory;
|
||||
|
||||
@Parameter(property = "stubsDirectory", defaultValue = "${project.build.directory}/stubs")
|
||||
@Parameter(property = "stubsDirectory",
|
||||
defaultValue = "${project.build.directory}/stubs")
|
||||
private File outputDirectory;
|
||||
|
||||
/**
|
||||
@@ -56,7 +58,8 @@ public class PushStubsToScmMojo extends AbstractMojo {
|
||||
/**
|
||||
* Set this to "true" to bypass only JAR creation.
|
||||
*/
|
||||
@Parameter(property = "spring.cloud.contract.verifier.publish-stubs-to-scm.skip", defaultValue = "false")
|
||||
@Parameter(property = "spring.cloud.contract.verifier.publish-stubs-to-scm.skip",
|
||||
defaultValue = "false")
|
||||
private boolean taskSkip;
|
||||
|
||||
@Parameter(defaultValue = "${project}", readonly = true)
|
||||
|
||||
@@ -45,7 +45,8 @@ import org.springframework.util.StringUtils;
|
||||
* @author Mariusz Smykula
|
||||
*/
|
||||
@SuppressWarnings("FieldCanBeLocal")
|
||||
@Mojo(name = "run", requiresProject = false, requiresDependencyResolution = ResolutionScope.RUNTIME)
|
||||
@Mojo(name = "run", requiresProject = false,
|
||||
requiresDependencyResolution = ResolutionScope.RUNTIME)
|
||||
public class RunMojo extends AbstractMojo {
|
||||
|
||||
private final LocalStubRunner localStubRunner;
|
||||
@@ -64,7 +65,8 @@ public class RunMojo extends AbstractMojo {
|
||||
/**
|
||||
* HTTP port for the WireMock server that serves stubs.
|
||||
*/
|
||||
@Parameter(property = "spring.cloud.contract.verifier.http.port", defaultValue = "8080")
|
||||
@Parameter(property = "spring.cloud.contract.verifier.http.port",
|
||||
defaultValue = "8080")
|
||||
private int httpPort;
|
||||
|
||||
/**
|
||||
@@ -76,7 +78,8 @@ public class RunMojo extends AbstractMojo {
|
||||
/**
|
||||
* Set this to "true" to bypass verifier test generation.
|
||||
*/
|
||||
@Parameter(property = "spring.cloud.contract.verifier.skipTestOnly", defaultValue = "false")
|
||||
@Parameter(property = "spring.cloud.contract.verifier.skipTestOnly",
|
||||
defaultValue = "false")
|
||||
private boolean skipTestOnly;
|
||||
|
||||
/**
|
||||
@@ -88,19 +91,22 @@ public class RunMojo extends AbstractMojo {
|
||||
/**
|
||||
* Minimal port at which the stub should start.
|
||||
*/
|
||||
@Parameter(property = "spring.cloud.contract.verifier.http.minPort", defaultValue = "10000")
|
||||
@Parameter(property = "spring.cloud.contract.verifier.http.minPort",
|
||||
defaultValue = "10000")
|
||||
private int minPort;
|
||||
|
||||
/**
|
||||
* Maximal port at which the stub should start.
|
||||
*/
|
||||
@Parameter(property = "spring.cloud.contract.verifier.http.maxPort", defaultValue = "15000")
|
||||
@Parameter(property = "spring.cloud.contract.verifier.http.maxPort",
|
||||
defaultValue = "15000")
|
||||
private int maxPort;
|
||||
|
||||
/**
|
||||
* Should the plugin wait for the user to press the key after starting the stubs.
|
||||
*/
|
||||
@Parameter(property = "spring.cloud.contract.verifier.wait-for-key-pressed", defaultValue = "true")
|
||||
@Parameter(property = "spring.cloud.contract.verifier.wait-for-key-pressed",
|
||||
defaultValue = "true")
|
||||
private boolean waitForKeyPressed;
|
||||
|
||||
/**
|
||||
|
||||
@@ -44,7 +44,8 @@ import static org.mockito.Mockito.when;
|
||||
*/
|
||||
@Configuration
|
||||
@ConditionalOnBean(ContractVerifierAmqpAutoConfiguration.class)
|
||||
@ConditionalOnProperty(value = "stubrunner.amqp.mockConnection", havingValue = "true", matchIfMissing = true)
|
||||
@ConditionalOnProperty(value = "stubrunner.amqp.mockConnection", havingValue = "true",
|
||||
matchIfMissing = true)
|
||||
public class RabbitMockConnectionFactoryAutoConfiguration {
|
||||
|
||||
@Bean
|
||||
|
||||
@@ -38,7 +38,8 @@ import org.springframework.context.annotation.Import;
|
||||
@Configuration
|
||||
@ConditionalOnClass(Message.class)
|
||||
@Import(CamelAutoConfiguration.class)
|
||||
@ConditionalOnProperty(name = "stubrunner.camel.enabled", havingValue = "true", matchIfMissing = true)
|
||||
@ConditionalOnProperty(name = "stubrunner.camel.enabled", havingValue = "true",
|
||||
matchIfMissing = true)
|
||||
@AutoConfigureBefore(NoOpContractVerifierAutoConfiguration.class)
|
||||
public class ContractVerifierCamelConfiguration {
|
||||
|
||||
|
||||
@@ -37,7 +37,8 @@ import org.springframework.util.Assert;
|
||||
*/
|
||||
@Configuration
|
||||
@ConditionalOnClass({ EnableBinding.class, MessageCollector.class })
|
||||
@ConditionalOnProperty(name = "stubrunner.stream.enabled", havingValue = "true", matchIfMissing = true)
|
||||
@ConditionalOnProperty(name = "stubrunner.stream.enabled", havingValue = "true",
|
||||
matchIfMissing = true)
|
||||
@AutoConfigureBefore(NoOpContractVerifierAutoConfiguration.class)
|
||||
public class ContractVerifierStreamAutoConfiguration {
|
||||
|
||||
|
||||
@@ -40,7 +40,8 @@ public class WireMockRestTemplateConfiguration {
|
||||
|
||||
@Bean
|
||||
@ConditionalOnClass(SSLContextBuilder.class)
|
||||
@ConditionalOnProperty(value = "wiremock.rest-template-ssl-enabled", matchIfMissing = true)
|
||||
@ConditionalOnProperty(value = "wiremock.rest-template-ssl-enabled",
|
||||
matchIfMissing = true)
|
||||
public RestTemplateCustomizer wiremockRestTemplateCustomizer() {
|
||||
return new RestTemplateCustomizer() {
|
||||
@Override
|
||||
|
||||
@@ -31,7 +31,9 @@ import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = WiremockTestsApplication.class, properties = "app.baseUrl=http://localhost:${wiremock.server.port}", webEnvironment = WebEnvironment.NONE)
|
||||
@SpringBootTest(classes = WiremockTestsApplication.class,
|
||||
properties = "app.baseUrl=http://localhost:${wiremock.server.port}",
|
||||
webEnvironment = WebEnvironment.NONE)
|
||||
@AutoConfigureWireMock(port = 12345)
|
||||
public class AutoConfigureWireMockApplicationTests {
|
||||
|
||||
|
||||
@@ -27,7 +27,9 @@ import org.springframework.test.context.junit4.SpringRunner;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = WiremockTestsApplication.class, properties = "app.baseUrl=http://localhost:${wiremock.server.port}", webEnvironment = WebEnvironment.NONE)
|
||||
@SpringBootTest(classes = WiremockTestsApplication.class,
|
||||
properties = "app.baseUrl=http://localhost:${wiremock.server.port}",
|
||||
webEnvironment = WebEnvironment.NONE)
|
||||
@AutoConfigureWireMock(port = 0)
|
||||
// Default stubs work at classpath:/mappings
|
||||
public class AutoConfigureWireMockAutoStubsApplicationTests {
|
||||
|
||||
@@ -30,8 +30,11 @@ import org.springframework.test.context.junit4.SpringRunner;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = { WiremockTestsApplication.class,
|
||||
AutoConfigureWireMockConfigurationCustomizerTests.Config.class }, properties = "app.baseUrl=http://localhost:${wiremock.server.port}", webEnvironment = WebEnvironment.NONE)
|
||||
@SpringBootTest(
|
||||
classes = { WiremockTestsApplication.class,
|
||||
AutoConfigureWireMockConfigurationCustomizerTests.Config.class },
|
||||
properties = "app.baseUrl=http://localhost:${wiremock.server.port}",
|
||||
webEnvironment = WebEnvironment.NONE)
|
||||
@AutoConfigureWireMock(port = 0, stubs = "file:src/test/resources/io.stubs/mappings")
|
||||
public class AutoConfigureWireMockConfigurationCustomizerTests {
|
||||
|
||||
|
||||
@@ -27,7 +27,9 @@ import org.springframework.test.context.junit4.SpringRunner;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = WiremockTestsApplication.class, properties = "app.baseUrl=http://localhost:${wiremock.server.port}", webEnvironment = WebEnvironment.NONE)
|
||||
@SpringBootTest(classes = WiremockTestsApplication.class,
|
||||
properties = "app.baseUrl=http://localhost:${wiremock.server.port}",
|
||||
webEnvironment = WebEnvironment.NONE)
|
||||
@AutoConfigureWireMock(port = 0, files = "classpath:/root/")
|
||||
public class AutoConfigureWireMockFilesApplicationTests {
|
||||
|
||||
|
||||
@@ -28,7 +28,10 @@ import org.springframework.test.context.junit4.SpringRunner;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = AutoConfigureWireMockFilesApplicationWithUrlResourceTests.Config.class, properties = "app.baseUrl=http://localhost:${wiremock.server.port}", webEnvironment = SpringBootTest.WebEnvironment.NONE)
|
||||
@SpringBootTest(
|
||||
classes = AutoConfigureWireMockFilesApplicationWithUrlResourceTests.Config.class,
|
||||
properties = "app.baseUrl=http://localhost:${wiremock.server.port}",
|
||||
webEnvironment = SpringBootTest.WebEnvironment.NONE)
|
||||
// tag::load_all_stubs[]
|
||||
@AutoConfigureWireMock(port = 0, stubs = "classpath*:/META-INF/**/mappings/**/*.json")
|
||||
// end::load_all_stubs[]
|
||||
|
||||
@@ -27,7 +27,9 @@ import org.springframework.test.context.junit4.SpringRunner;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = WiremockTestsApplication.class, properties = "app.baseUrl=http://localhost:${wiremock.server.port}", webEnvironment = WebEnvironment.NONE)
|
||||
@SpringBootTest(classes = WiremockTestsApplication.class,
|
||||
properties = "app.baseUrl=http://localhost:${wiremock.server.port}",
|
||||
webEnvironment = WebEnvironment.NONE)
|
||||
@AutoConfigureWireMock(port = 0, files = "classpath:root")
|
||||
public class AutoConfigureWireMockFilesApplicationWithoutSlashTests {
|
||||
|
||||
|
||||
@@ -31,7 +31,9 @@ import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = WiremockTestsApplication.class, properties = "app.baseUrl=https://localhost:${wiremock.server.https-port}", webEnvironment = WebEnvironment.NONE)
|
||||
@SpringBootTest(classes = WiremockTestsApplication.class,
|
||||
properties = "app.baseUrl=https://localhost:${wiremock.server.https-port}",
|
||||
webEnvironment = WebEnvironment.NONE)
|
||||
@AutoConfigureWireMock(httpsPort = 9999, port = 0)
|
||||
public class AutoConfigureWireMockHttpsPortApplicationTests {
|
||||
|
||||
|
||||
@@ -31,7 +31,9 @@ import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = WiremockTestsApplication.class, properties = "app.baseUrl=http://localhost:${wiremock.server.port}", webEnvironment = WebEnvironment.NONE)
|
||||
@SpringBootTest(classes = WiremockTestsApplication.class,
|
||||
properties = "app.baseUrl=http://localhost:${wiremock.server.port}",
|
||||
webEnvironment = WebEnvironment.NONE)
|
||||
@AutoConfigureWireMock(port = 9999)
|
||||
public class AutoConfigureWireMockPortApplicationTests {
|
||||
|
||||
|
||||
@@ -33,7 +33,9 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
@DirtiesContext(classMode = DirtiesContext.ClassMode.BEFORE_CLASS)
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = WiremockTestsApplication.class, properties = "app.baseUrl=http://localhost:${wiremock.server.port}", webEnvironment = WebEnvironment.NONE)
|
||||
@SpringBootTest(classes = WiremockTestsApplication.class,
|
||||
properties = "app.baseUrl=http://localhost:${wiremock.server.port}",
|
||||
webEnvironment = WebEnvironment.NONE)
|
||||
@AutoConfigureWireMock(port = 0)
|
||||
public class AutoConfigureWireMockRandomPortApplicationTests {
|
||||
|
||||
|
||||
@@ -31,7 +31,9 @@ import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = WiremockTestsApplication.class, properties = "app.baseUrl=https://localhost:${wiremock.server.https-port}", webEnvironment = WebEnvironment.NONE)
|
||||
@SpringBootTest(classes = WiremockTestsApplication.class,
|
||||
properties = "app.baseUrl=https://localhost:${wiremock.server.https-port}",
|
||||
webEnvironment = WebEnvironment.NONE)
|
||||
@AutoConfigureWireMock(port = 0, httpsPort = 0)
|
||||
public class AutoConfigureWireMockRandomPortHttpsApplicationTests {
|
||||
|
||||
|
||||
@@ -31,7 +31,9 @@ import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = WiremockTestsApplication.class, properties = "app.baseUrl=http://localhost:${wiremock.server.port}", webEnvironment = WebEnvironment.NONE)
|
||||
@SpringBootTest(classes = WiremockTestsApplication.class,
|
||||
properties = "app.baseUrl=http://localhost:${wiremock.server.port}",
|
||||
webEnvironment = WebEnvironment.NONE)
|
||||
@AutoConfigureWireMock(port = 9999)
|
||||
// Should manage to register
|
||||
public class AutoConfigureWireMockSamePortApplicationTests {
|
||||
|
||||
@@ -27,8 +27,11 @@ import org.springframework.test.context.junit4.SpringRunner;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = WiremockTestsApplication.class, properties = "app.baseUrl=http://localhost:${wiremock.server.port}", webEnvironment = WebEnvironment.NONE)
|
||||
@AutoConfigureWireMock(port = 0, files = "classpath:/root/", stubs = "file:src/test/resources/io.stubs/mappings")
|
||||
@SpringBootTest(classes = WiremockTestsApplication.class,
|
||||
properties = "app.baseUrl=http://localhost:${wiremock.server.port}",
|
||||
webEnvironment = WebEnvironment.NONE)
|
||||
@AutoConfigureWireMock(port = 0, files = "classpath:/root/",
|
||||
stubs = "file:src/test/resources/io.stubs/mappings")
|
||||
public class AutoConfigureWireMockStubsAndFilesApplicationTests {
|
||||
|
||||
@Autowired
|
||||
|
||||
@@ -27,9 +27,12 @@ import org.springframework.test.context.junit4.SpringRunner;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = WiremockTestsApplication.class, properties = "app.baseUrl=http://localhost:${wiremock.server.port}", webEnvironment = WebEnvironment.NONE)
|
||||
@AutoConfigureWireMock(port = 0, files = { "classpath:/", "classpath:/root/",
|
||||
"classpath:/nonexistent/" }, stubs = "file:src/test/resources/io.stubs/mappings")
|
||||
@SpringBootTest(classes = WiremockTestsApplication.class,
|
||||
properties = "app.baseUrl=http://localhost:${wiremock.server.port}",
|
||||
webEnvironment = WebEnvironment.NONE)
|
||||
@AutoConfigureWireMock(port = 0,
|
||||
files = { "classpath:/", "classpath:/root/", "classpath:/nonexistent/" },
|
||||
stubs = "file:src/test/resources/io.stubs/mappings")
|
||||
public class AutoConfigureWireMockStubsAndMultipleFilesApplicationTests {
|
||||
|
||||
@Autowired
|
||||
|
||||
@@ -27,7 +27,9 @@ import org.springframework.test.context.junit4.SpringRunner;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = WiremockTestsApplication.class, properties = "app.baseUrl=http://localhost:${wiremock.server.port}", webEnvironment = WebEnvironment.NONE)
|
||||
@SpringBootTest(classes = WiremockTestsApplication.class,
|
||||
properties = "app.baseUrl=http://localhost:${wiremock.server.port}",
|
||||
webEnvironment = WebEnvironment.NONE)
|
||||
@AutoConfigureWireMock(port = 0, stubs = "file:src/test/resources/io.stubs/mappings")
|
||||
public class AutoConfigureWireMockStubsApplicationTests {
|
||||
|
||||
|
||||
@@ -27,7 +27,9 @@ import org.springframework.test.context.junit4.SpringRunner;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = WiremockTestsApplication.class, properties = "app.baseUrl=http://localhost:${wiremock.server.port}", webEnvironment = WebEnvironment.NONE)
|
||||
@SpringBootTest(classes = WiremockTestsApplication.class,
|
||||
properties = "app.baseUrl=http://localhost:${wiremock.server.port}",
|
||||
webEnvironment = WebEnvironment.NONE)
|
||||
@AutoConfigureWireMock(port = 0, stubs = "file:src/test/resources/io.stubs/mappings/")
|
||||
public class AutoConfigureWireMockStubsApplicationWithSlashTests {
|
||||
|
||||
|
||||
@@ -32,7 +32,8 @@ import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = WiremockTestsApplication.class, properties = "app.baseUrl=https://localhost:8443")
|
||||
@SpringBootTest(classes = WiremockTestsApplication.class,
|
||||
properties = "app.baseUrl=https://localhost:8443")
|
||||
public class WiremockHttpsServerApplicationTests {
|
||||
|
||||
@ClassRule
|
||||
|
||||
@@ -33,7 +33,9 @@ import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = WiremockTestsApplication.class, properties = "app.baseUrl=http://localhost:5435", webEnvironment = WebEnvironment.NONE)
|
||||
@SpringBootTest(classes = WiremockTestsApplication.class,
|
||||
properties = "app.baseUrl=http://localhost:5435",
|
||||
webEnvironment = WebEnvironment.NONE)
|
||||
public class WiremockServerApplicationTests {
|
||||
|
||||
@ClassRule
|
||||
|
||||
Reference in New Issue
Block a user