Skip to content

Commit 19fa6ab

Browse files
authored
Upgrade org.wiremock dependency (#1599)
1 parent fa07ce6 commit 19fa6ab

File tree

16 files changed

+54
-57
lines changed

16 files changed

+54
-57
lines changed

spring-cloud-kubernetes-client-config/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@
8383
</dependency>
8484

8585
<dependency>
86-
<groupId>com.github.tomakehurst</groupId>
87-
<artifactId>wiremock-jre8-standalone</artifactId>
86+
<groupId>org.wiremock</groupId>
87+
<artifactId>wiremock-standalone</artifactId>
8888
<scope>test</scope>
8989
</dependency>
9090

spring-cloud-kubernetes-client-discovery/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@
6666
<scope>test</scope>
6767
</dependency>
6868
<dependency>
69-
<groupId>com.github.tomakehurst</groupId>
70-
<artifactId>wiremock-jre8-standalone</artifactId>
69+
<groupId>org.wiremock</groupId>
70+
<artifactId>wiremock-standalone</artifactId>
7171
<scope>test</scope>
7272
</dependency>
7373
<dependency>

spring-cloud-kubernetes-client-loadbalancer/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@
3737
<scope>test</scope>
3838
</dependency>
3939
<dependency>
40-
<groupId>com.github.tomakehurst</groupId>
41-
<artifactId>wiremock-jre8-standalone</artifactId>
40+
<groupId>org.wiremock</groupId>
41+
<artifactId>wiremock-standalone</artifactId>
4242
<scope>test</scope>
4343
</dependency>
4444
<dependency>

spring-cloud-kubernetes-controllers/spring-cloud-kubernetes-configserver/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@
4343
<scope>test</scope>
4444
</dependency>
4545
<dependency>
46-
<groupId>com.github.tomakehurst</groupId>
47-
<artifactId>wiremock-jre8-standalone</artifactId>
46+
<groupId>org.wiremock</groupId>
47+
<artifactId>wiremock-standalone</artifactId>
4848
<scope>test</scope>
4949
</dependency>
5050
<dependency>

spring-cloud-kubernetes-controllers/spring-cloud-kubernetes-configserver/src/test/java/org/springframework/cloud/kubernetes/configserver/BootstrapConfigServerIntegrationTest.java renamed to spring-cloud-kubernetes-controllers/spring-cloud-kubernetes-configserver/src/test/java/org/springframework/cloud/kubernetes/configserver/it/BootstrapConfigServerIntegrationTest.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2013-2021 the original author or authors.
2+
* Copyright 2013-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,9 +14,10 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.cloud.kubernetes.configserver;
17+
package org.springframework.cloud.kubernetes.configserver.it;
1818

1919
import org.springframework.boot.test.context.SpringBootTest;
20+
import org.springframework.cloud.kubernetes.configserver.KubernetesConfigServerApplication;
2021

2122
/**
2223
* @author Ryan Baxter
@@ -26,6 +27,6 @@
2627
"spring.profiles.include=kubernetes", "spring.cloud.kubernetes.secrets.enableApi=true",
2728
"spring.cloud.bootstrap.enabled=true" },
2829
classes = { KubernetesConfigServerApplication.class })
29-
public class BootstrapConfigServerIntegrationTest extends ConfigServerIntegrationTest {
30+
class BootstrapConfigServerIntegrationTest extends ConfigServerIntegrationTest {
3031

3132
}

spring-cloud-kubernetes-controllers/spring-cloud-kubernetes-configserver/src/test/java/org/springframework/cloud/kubernetes/configserver/ConfigDataConfigServerIntegrationTest.java renamed to spring-cloud-kubernetes-controllers/spring-cloud-kubernetes-configserver/src/test/java/org/springframework/cloud/kubernetes/configserver/it/ConfigDataConfigServerIntegrationTest.java

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2013-2021 the original author or authors.
2+
* Copyright 2013-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,20 +14,19 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.cloud.kubernetes.configserver;
17+
package org.springframework.cloud.kubernetes.configserver.it;
1818

19-
import com.github.tomakehurst.wiremock.WireMockServer;
2019
import com.github.tomakehurst.wiremock.client.WireMock;
2120
import io.kubernetes.client.util.ClientBuilder;
22-
import org.junit.jupiter.api.AfterAll;
2321
import org.junit.jupiter.api.AfterEach;
24-
import org.junit.jupiter.api.BeforeAll;
22+
import org.junit.jupiter.api.BeforeEach;
2523
import org.mockito.MockedStatic;
2624

2725
import org.springframework.boot.test.context.SpringBootTest;
2826
import org.springframework.cloud.kubernetes.client.KubernetesClientUtils;
27+
import org.springframework.cloud.kubernetes.configserver.KubernetesConfigServerApplication;
28+
import org.springframework.cloud.kubernetes.configserver.TestBootstrapConfig;
2929

30-
import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.options;
3130
import static org.mockito.Mockito.mockStatic;
3231

3332
/**
@@ -36,27 +35,20 @@
3635
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
3736
properties = { "spring.main.cloud-platform=KUBERNETES", "spring.cloud.kubernetes.client.namespace=default",
3837
"spring.profiles.include=kubernetes", "spring.cloud.kubernetes.secrets.enableApi=true" },
39-
classes = { KubernetesConfigServerApplication.class })
40-
public class ConfigDataConfigServerIntegrationTest extends ConfigServerIntegrationTest {
38+
classes = { KubernetesConfigServerApplication.class, TestBootstrapConfig.class })
39+
class ConfigDataConfigServerIntegrationTest extends ConfigServerIntegrationTest {
4140

42-
private static WireMockServer wireMockServer;
43-
44-
private static MockedStatic<KubernetesClientUtils> clientUtilsMock;
45-
46-
@BeforeAll
47-
static void setup() {
48-
wireMockServer = new WireMockServer(options().dynamicPort());
49-
wireMockServer.start();
50-
WireMock.configureFor(wireMockServer.port());
41+
private MockedStatic<KubernetesClientUtils> clientUtilsMock;
5142

43+
@BeforeEach
44+
void setup() {
5245
clientUtilsMock = mockStatic(KubernetesClientUtils.class);
5346
clientUtilsMock.when(KubernetesClientUtils::kubernetesApiClient)
5447
.thenReturn(new ClientBuilder().setBasePath(wireMockServer.baseUrl()).build());
5548
}
5649

57-
@AfterAll
58-
static void teardown() {
59-
wireMockServer.stop();
50+
@AfterEach
51+
void teardown() {
6052
clientUtilsMock.close();
6153
}
6254

spring-cloud-kubernetes-controllers/spring-cloud-kubernetes-configserver/src/test/java/org/springframework/cloud/kubernetes/configserver/ConfigServerIntegrationTest.java renamed to spring-cloud-kubernetes-controllers/spring-cloud-kubernetes-configserver/src/test/java/org/springframework/cloud/kubernetes/configserver/it/ConfigServerIntegrationTest.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2013-2021 the original author or authors.
2+
* Copyright 2013-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,8 +14,9 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.cloud.kubernetes.configserver;
17+
package org.springframework.cloud.kubernetes.configserver.it;
1818

19+
import com.github.tomakehurst.wiremock.WireMockServer;
1920
import com.github.tomakehurst.wiremock.client.WireMock;
2021
import io.kubernetes.client.openapi.JSON;
2122
import io.kubernetes.client.openapi.models.V1ConfigMapBuilder;
@@ -45,8 +46,11 @@ abstract class ConfigServerIntegrationTest {
4546
@Autowired
4647
private TestRestTemplate testRestTemplate;
4748

49+
@Autowired
50+
WireMockServer wireMockServer;
51+
4852
@BeforeEach
49-
public void beforeEach() {
53+
void beforeEach() {
5054
V1ConfigMapList TEST_CONFIGMAP = new V1ConfigMapList().addItemsItem(new V1ConfigMapBuilder().withMetadata(
5155
new V1ObjectMetaBuilder().withName("test-cm").withNamespace("default").withResourceVersion("1").build())
5256
.addToData("app.name", "test").build());
@@ -67,7 +71,7 @@ public void beforeEach() {
6771
}
6872

6973
@Test
70-
public void enabled() {
74+
void enabled() {
7175
Environment env = testRestTemplate.getForObject("/test-cm/default", Environment.class);
7276
assertThat(env.getPropertySources().size()).isEqualTo(2);
7377
assertThat(env.getPropertySources().get(0).getName().equals("configmap.test-cm.default")).isTrue();

spring-cloud-kubernetes-controllers/spring-cloud-kubernetes-configuration-watcher/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@
5151
</exclusions>
5252
</dependency>
5353
<dependency>
54-
<groupId>com.github.tomakehurst</groupId>
55-
<artifactId>wiremock-jre8-standalone</artifactId>
54+
<groupId>org.wiremock</groupId>
55+
<artifactId>wiremock-standalone</artifactId>
5656
<scope>test</scope>
5757
</dependency>
5858

spring-cloud-kubernetes-controllers/spring-cloud-kubernetes-discoveryserver/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@
4040
<scope>test</scope>
4141
</dependency>
4242
<dependency>
43-
<groupId>com.github.tomakehurst</groupId>
44-
<artifactId>wiremock-jre8-standalone</artifactId>
43+
<groupId>org.wiremock</groupId>
44+
<artifactId>wiremock-standalone</artifactId>
4545
<scope>test</scope>
4646
</dependency>
4747
<dependency>

spring-cloud-kubernetes-dependencies/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
<hoverfly.version>0.13.0</hoverfly.version>
3636
<kubernetes-fabric8-client.version>6.9.2</kubernetes-fabric8-client.version>
3737
<kubernetes-native-client.version>19.0.0</kubernetes-native-client.version>
38-
<wiremock.version>2.26.3</wiremock.version>
38+
<wiremock.version>3.4.2</wiremock.version>
3939
<commons.collections4.version>4.4</commons.collections4.version>
4040
</properties>
4141
<dependencyManagement>
@@ -213,8 +213,8 @@
213213
</dependency>
214214

215215
<dependency>
216-
<groupId>com.github.tomakehurst</groupId>
217-
<artifactId>wiremock-jre8-standalone</artifactId>
216+
<groupId>org.wiremock</groupId>
217+
<artifactId>wiremock-standalone</artifactId>
218218
<version>${wiremock.version}</version>
219219
<scope>test</scope>
220220
</dependency>

0 commit comments

Comments
 (0)