Skip to content

Commit f7fc0e1

Browse files
committed
chore(deps)!: WireMock 4
1 parent 3c91092 commit f7fc0e1

File tree

2 files changed

+18
-32
lines changed

2 files changed

+18
-32
lines changed

build.gradle

Lines changed: 17 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ sourceCompatibility = 17
1818
targetCompatibility = 17
1919
apply plugin: "org.wiremock.tools.gradle.wiremock-extension-convention"
2020

21-
2221
group 'org.wiremock.integrations'
2322

2423
jar {
@@ -28,9 +27,6 @@ jar {
2827
}
2928
}
3029

31-
// Because older version is set in wiremock-extension-convention
32-
def wiremockVersion = "3.13.0"
33-
3430
configurations {
3531
all*.exclude group: 'org.eclipse.jetty', module: 'jetty-servlet'
3632
all*.exclude group: 'org.eclipse.jetty', module: 'jetty-servlets'
@@ -40,38 +36,29 @@ configurations {
4036

4137
dependencies {
4238
implementation platform("org.eclipse.jetty:jetty-bom:12.0.15")
43-
api "org.wiremock:wiremock-jetty12:${wiremockVersion}"
44-
45-
api "org.springframework.boot:spring-boot-test:3.4.1"
46-
api "org.springframework:spring-test:6.1.13"
47-
api "org.slf4j:slf4j-api:2.0.16"
48-
api 'org.junit.jupiter:junit-jupiter-api:5.11.2'
39+
api "org.wiremock:wiremock-jetty:4.0.0-beta.9"
40+
/**
41+
* We don't want a user to accidentally test with another version of these dependencies.
42+
* Intentionally using compileOnly to avoid them being transitive.
43+
*/
44+
compileOnly 'org.springframework.boot:spring-boot-test:3.5.0'
45+
compileOnly 'org.junit.jupiter:junit-jupiter-api:5.12.2'
46+
compileOnly 'org.slf4j:slf4j-api:2.0.17'
4947

50-
testImplementation "org.wiremock:wiremock-jetty12:${wiremockVersion}"
51-
testImplementation "org.springframework.boot:spring-boot-starter-test:3.4.1"
52-
testImplementation 'org.assertj:assertj-core:3.26.3'
53-
testImplementation platform('org.junit:junit-bom:5.11.2')
48+
testImplementation 'org.springframework.boot:spring-boot-starter-web:3.5.0'
49+
testImplementation 'org.springframework.boot:spring-boot-test:3.5.0'
50+
testImplementation 'org.slf4j:slf4j-api:2.0.17'
51+
testImplementation 'org.assertj:assertj-core:3.27.3'
5452
testImplementation 'org.junit.jupiter:junit-jupiter'
55-
testImplementation 'org.junit.platform:junit-platform-launcher'
56-
testImplementation 'io.rest-assured:rest-assured:5.5.0'
57-
testImplementation 'io.rest-assured:rest-assured:5.5.0'
58-
testImplementation "org.springframework.boot:spring-boot-starter-web:3.4.1"
59-
testImplementation 'io.cucumber:cucumber-java:7.20.1'
60-
testImplementation 'io.cucumber:cucumber-spring:7.20.1'
61-
testImplementation 'io.cucumber:cucumber-junit-platform-engine:7.20.1'
62-
testImplementation 'org.junit.platform:junit-platform-suite:1.11.4'
63-
testImplementation 'org.assertj:assertj-core:3.26.3'
64-
65-
constraints {
66-
implementation('org.apache.commons:commons-compress:1.26.0') {
67-
because 'version 1.24.0 has a vulnerability'
68-
}
69-
}
53+
testImplementation 'io.rest-assured:rest-assured:5.5.5'
54+
testImplementation 'io.cucumber:cucumber-java:7.23.0'
55+
testImplementation 'io.cucumber:cucumber-spring:7.23.0'
56+
testImplementation 'io.cucumber:cucumber-junit-platform-engine:7.23.0'
57+
testImplementation 'org.junit.platform:junit-platform-suite:1.12.2'
7058
}
7159

7260
// Not using shadowJar, but currently not possible to disable in wiremock-extension-convention
7361
shadowJar {
7462
mergeServiceFiles()
75-
7663
exclude '**/*'
7764
}

src/test/java/usecases/NotEnabledTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import static org.junit.jupiter.api.Assertions.assertThrows;
77

88
import com.github.tomakehurst.wiremock.client.WireMock;
9-
import org.apache.hc.client5.http.HttpHostConnectException;
109
import org.junit.jupiter.api.Test;
1110
import org.springframework.beans.factory.annotation.Autowired;
1211
import org.springframework.boot.test.context.SpringBootTest;
@@ -20,7 +19,7 @@ class NotEnabledTest {
2019
@Test
2120
void shouldNotHaveWireMockConfigured() {
2221
assertThrows(
23-
HttpHostConnectException.class,
22+
java.net.ConnectException.class,
2423
() -> WireMock.stubFor(get("/ping").willReturn(aResponse().withStatus(200))));
2524

2625
assertThat(this.env.getProperty("wiremock.server.baseUrl")).isNull();

0 commit comments

Comments
 (0)