Parametrized maven; fixes gh-813

This commit is contained in:
Marcin Grzejszczak
2019-02-18 11:57:33 +01:00
parent ab49216445
commit 4747adf9bc
8 changed files with 27 additions and 12 deletions

View File

@@ -47,7 +47,7 @@
<!-- We need to have compatibility with Gradle -->
<groovy.version>2.4.15</groovy.version>
<!-- For Takari plugin -->
<maven.version>3.2.1</maven.version>
<maven.version>3.3.9</maven.version>
<aether.version>1.1.0</aether.version>
<xpath2.processor.version>2.1.100</xpath2.processor.version>
<xerces.version>2.11.0</xerces.version>

View File

@@ -18,6 +18,7 @@
<wiremock.version>2.20.0</wiremock.version>
<jsonassert.version>0.4.13</jsonassert.version>
<rest-assured.version>3.2.0</rest-assured.version>
<maven.version>3.3.9</maven.version>
</properties>
<dependencyManagement>
<dependencies>
@@ -138,7 +139,7 @@
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-settings-builder</artifactId>
<version>3.2.1</version>
<version>${maven.version}</version>
</dependency>
</dependencies>
</dependencyManagement>

View File

@@ -51,7 +51,8 @@ public class AutoConfigureWireMockApplicationTests {
@Test
public void portsAreFixed() {
boolean httpPortDynamic = this.wireMockProperties.getServer().isPortDynamic();
boolean httpsPortDynamic = this.wireMockProperties.getServer().isHttpsPortDynamic();
boolean httpsPortDynamic = this.wireMockProperties.getServer()
.isHttpsPortDynamic();
assertThat(!httpPortDynamic || !httpsPortDynamic).isTrue();
}

View File

@@ -46,7 +46,8 @@ public class AutoConfigureWireMockAutoStubsApplicationTests {
@Test
public void portsAreNotFixed() {
boolean httpPortDynamic = this.wireMockProperties.getServer().isPortDynamic();
boolean httpsPortDynamic = this.wireMockProperties.getServer().isHttpsPortDynamic();
boolean httpsPortDynamic = this.wireMockProperties.getServer()
.isHttpsPortDynamic();
assertThat(!httpPortDynamic || !httpsPortDynamic).isFalse();
}

View File

@@ -51,7 +51,8 @@ public class AutoConfigureWireMockHttpsPortApplicationTests {
@Test
public void portsAreFixed() {
boolean httpPortDynamic = this.wireMockProperties.getServer().isPortDynamic();
boolean httpsPortDynamic = this.wireMockProperties.getServer().isHttpsPortDynamic();
boolean httpsPortDynamic = this.wireMockProperties.getServer()
.isHttpsPortDynamic();
assertThat(!httpPortDynamic || !httpsPortDynamic).isTrue();
}

View File

@@ -51,7 +51,8 @@ public class AutoConfigureWireMockRandomPortHttpsApplicationTests {
@Test
public void portsAreNotFixed() {
boolean httpPortDynamic = this.wireMockProperties.getServer().isPortDynamic();
boolean httpsPortDynamic = this.wireMockProperties.getServer().isHttpsPortDynamic();
boolean httpsPortDynamic = this.wireMockProperties.getServer()
.isHttpsPortDynamic();
assertThat(httpPortDynamic).isTrue();
assertThat(httpsPortDynamic).isTrue();
}

View File

@@ -90,10 +90,9 @@ class Service {
public String pom() {
String requestUrl = this.base + "/pom.xml";
log.info("Will send a request to [" + requestUrl + "]");
return this.restTemplate
.exchange(RequestEntity.get(URI.create(requestUrl))
.accept(mediaTypes()).build(), String.class)
.getBody();
return this.restTemplate.exchange(
RequestEntity.get(URI.create(requestUrl)).accept(mediaTypes()).build(),
String.class).getBody();
}
private MediaType[] mediaTypes() {
@@ -106,8 +105,7 @@ class Service {
public String go2() {
String requestUrl = this.base + "/test2";
log.info("Will send a request to [" + requestUrl + "]");
return this.restTemplate.getForEntity(requestUrl, String.class)
.getBody();
return this.restTemplate.getForEntity(requestUrl, String.class).getBody();
}
public void setBase(String base) {

View File

@@ -20,6 +20,12 @@
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-contract-stub-runner</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-contract-shade</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.github.dreamhead</groupId>
@@ -29,6 +35,12 @@
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-contract-verifier</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-contract-shade</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>