Skip to content

Commit ada98d2

Browse files
authored
Merge pull request #2073 from wind57/change_code_for_json_serialization
change serialization code in tests
2 parents 8224009 + 3b87991 commit ada98d2

File tree

30 files changed

+63
-63
lines changed

30 files changed

+63
-63
lines changed

spring-cloud-kubernetes-client-config/src/test/java/org/springframework/cloud/kubernetes/client/config/KubernetesClientConfigReloadAutoConfigurationTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ void beforeEach() {
117117
.build());
118118

119119
WireMock.stubFor(get(urlMatching("^/api/v1/namespaces/default/configmaps.*"))
120-
.willReturn(aResponse().withStatus(200).withBody(new JSON().serialize(TEST_CONFIGMAP))));
120+
.willReturn(aResponse().withStatus(200).withBody(JSON.serialize(TEST_CONFIGMAP))));
121121
}
122122

123123
// 1. watchers

spring-cloud-kubernetes-client-config/src/test/java/org/springframework/cloud/kubernetes/client/config/bootstrap/stubs/BootstrapKubernetesClientSanitizeEnvEndpointStub.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,10 @@ public static void stubData() {
9292
secretList.addItemsItem(secretTwo);
9393

9494
WireMock.stubFor(WireMock.get("/api/v1/namespaces/test/configmaps")
95-
.willReturn(WireMock.aResponse().withStatus(200).withBody(new JSON().serialize(configMapList))));
95+
.willReturn(WireMock.aResponse().withStatus(200).withBody(JSON.serialize(configMapList))));
9696

9797
WireMock.stubFor(WireMock.get("/api/v1/namespaces/test/secrets")
98-
.willReturn(WireMock.aResponse().withStatus(200).withBody(new JSON().serialize(secretList))));
98+
.willReturn(WireMock.aResponse().withStatus(200).withBody(JSON.serialize(secretList))));
9999
}
100100

101101
}

spring-cloud-kubernetes-client-config/src/test/java/org/springframework/cloud/kubernetes/client/config/bootstrap/stubs/LabeledConfigMapWithPrefixConfigurationStub.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public static void stubData() {
106106
configMapList.addItemsItem(four);
107107

108108
WireMock.stubFor(WireMock.get("/api/v1/namespaces/spring-k8s/configmaps")
109-
.willReturn(WireMock.aResponse().withStatus(200).withBody(new JSON().serialize(configMapList))));
109+
.willReturn(WireMock.aResponse().withStatus(200).withBody(JSON.serialize(configMapList))));
110110
}
111111

112112
}

spring-cloud-kubernetes-client-config/src/test/java/org/springframework/cloud/kubernetes/client/config/bootstrap/stubs/LabeledConfigMapWithProfileConfigurationStub.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ public static void stubData() {
173173
configMaps.addItemsItem(greenPurpleConfigMapK8s);
174174

175175
WireMock.stubFor(WireMock.get("/api/v1/namespaces/spring-k8s/configmaps")
176-
.willReturn(WireMock.aResponse().withStatus(200).withBody(new JSON().serialize(configMaps))));
176+
.willReturn(WireMock.aResponse().withStatus(200).withBody(JSON.serialize(configMaps))));
177177
}
178178

179179
}

spring-cloud-kubernetes-client-config/src/test/java/org/springframework/cloud/kubernetes/client/config/bootstrap/stubs/LabeledSecretWithPrefixConfigurationStub.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public static void stubData() {
109109
secrets.addItemsItem(four);
110110

111111
WireMock.stubFor(WireMock.get("/api/v1/namespaces/spring-k8s/secrets")
112-
.willReturn(WireMock.aResponse().withStatus(200).withBody(new JSON().serialize(secrets))));
112+
.willReturn(WireMock.aResponse().withStatus(200).withBody(JSON.serialize(secrets))));
113113
}
114114

115115
}

spring-cloud-kubernetes-client-config/src/test/java/org/springframework/cloud/kubernetes/client/config/bootstrap/stubs/LabeledSecretWithProfileConfigurationStub.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ public static void stubData() {
174174
secrets.addItemsItem(greenPurpleSecretK8s);
175175

176176
WireMock.stubFor(WireMock.get("/api/v1/namespaces/spring-k8s/secrets")
177-
.willReturn(WireMock.aResponse().withStatus(200).withBody(new JSON().serialize(secrets))));
177+
.willReturn(WireMock.aResponse().withStatus(200).withBody(JSON.serialize(secrets))));
178178
}
179179

180180
}

spring-cloud-kubernetes-client-config/src/test/java/org/springframework/cloud/kubernetes/client/config/bootstrap/stubs/NamedConfigMapWithPrefixConfigurationStub.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public static void stubData() {
9494

9595
// the actual stub for CoreV1Api calls
9696
WireMock.stubFor(WireMock.get("/api/v1/namespaces/spring-k8s/configmaps")
97-
.willReturn(WireMock.aResponse().withStatus(200).withBody(new JSON().serialize(allConfigMaps))));
97+
.willReturn(WireMock.aResponse().withStatus(200).withBody(JSON.serialize(allConfigMaps))));
9898
}
9999

100100
}

spring-cloud-kubernetes-client-config/src/test/java/org/springframework/cloud/kubernetes/client/config/bootstrap/stubs/NamedConfigMapWithProfileConfigurationStub.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public static void stubData() {
106106

107107
// the actual stub for CoreV1Api calls
108108
WireMock.stubFor(WireMock.get("/api/v1/namespaces/spring-k8s/configmaps")
109-
.willReturn(WireMock.aResponse().withStatus(200).withBody(new JSON().serialize(allConfigMaps))));
109+
.willReturn(WireMock.aResponse().withStatus(200).withBody(JSON.serialize(allConfigMaps))));
110110
}
111111

112112
}

spring-cloud-kubernetes-client-config/src/test/java/org/springframework/cloud/kubernetes/client/config/bootstrap/stubs/NamedSecretWithPrefixConfigurationStub.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public static void stubData() {
9393

9494
// the actual stub for CoreV1Api calls
9595
WireMock.stubFor(WireMock.get("/api/v1/namespaces/spring-k8s/secrets")
96-
.willReturn(WireMock.aResponse().withStatus(200).withBody(new JSON().serialize(allSecrets))));
96+
.willReturn(WireMock.aResponse().withStatus(200).withBody(JSON.serialize(allSecrets))));
9797
}
9898

9999
}

spring-cloud-kubernetes-client-config/src/test/java/org/springframework/cloud/kubernetes/client/config/bootstrap/stubs/NamedSecretWithProfileConfigurationStub.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ public static void stubData() {
123123

124124
// the actual stub for CoreV1Api calls
125125
WireMock.stubFor(WireMock.get("/api/v1/namespaces/spring-k8s/secrets")
126-
.willReturn(WireMock.aResponse().withStatus(200).withBody(new JSON().serialize(allSecrets))));
126+
.willReturn(WireMock.aResponse().withStatus(200).withBody(JSON.serialize(allSecrets))));
127127
}
128128

129129
}

0 commit comments

Comments
 (0)