Skip to content

Commit f619f60

Browse files
committed
cleanup
Signed-off-by: wind57 <[email protected]>
1 parent f1f94df commit f619f60

File tree

1 file changed

+24
-32
lines changed
  • spring-cloud-kubernetes-controllers/spring-cloud-kubernetes-configserver/src/test/java/org/springframework/cloud/kubernetes/configserver/it

1 file changed

+24
-32
lines changed

spring-cloud-kubernetes-controllers/spring-cloud-kubernetes-configserver/src/test/java/org/springframework/cloud/kubernetes/configserver/it/ConfigServerIntegration.java

Lines changed: 24 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -51,43 +51,35 @@ abstract class ConfigServerIntegration {
5151

5252
private static final String NAMESPACE = "default";
5353

54-
private static final String TEST_CONFIG_MAP_DEV_YAML = "test-cm-dev.yaml";
54+
private static final String TEST_CONFIG_MAP_DEV_PROPERTIES = "test-cm-dev.properties";
5555
private static final String TEST_CONFIG_MAP_DEV_NAME = "configmap.test-cm.default.dev";
5656
private static final String TEST_CONFIG_MAP_DEV_DATA = """
57-
dummy:
58-
property:
59-
profile: dev
60-
value: 1
61-
enabled: false
57+
dummy.property.profile=dev
58+
dummy.property.value=1
59+
dummy.property.enabled=false
6260
""";
6361

64-
private static final String TEST_CONFIG_MAP_QA_YAML = "test-cm-qa.yaml";
62+
private static final String TEST_CONFIG_MAP_QA_PROPERTIES = "test-cm-qa.properties";
6563
private static final String TEST_CONFIG_MAP_QA_DATA = """
66-
dummy:
67-
property:
68-
profile: qa
69-
value: 2
70-
enabled: true
64+
dummy.property.profile=qa
65+
dummy.property.value=2
66+
dummy.property.enabled=true
7167
""";
7268

73-
private static final String TEST_CONFIG_MAP_PROD_YAML = "test-cm-prod.yaml";
69+
private static final String TEST_CONFIG_MAP_PROD_PROPERTIES = "test-cm-prod.properties";
7470
private static final String TEST_CONFIG_MAP_PROD_NAME = "configmap.test-cm.default.prod";
7571
private static final String TEST_CONFIG_MAP_PROD_DATA = """
76-
dummy:
77-
property:
78-
profile: prod
79-
value: 3
80-
enabled: true
72+
dummy.property.profile=prod
73+
dummy.property.value=3
74+
dummy.property.enabled=true
8175
""";
8276

83-
private static final String TEST_CONFIG_MAP_YAML = "test-cm.yaml";
77+
private static final String TEST_CONFIG_MAP_PROPERTIES = "test-cm.properties";
8478
private static final String TEST_CONFIG_MAP_NAME = "configmap.test-cm.default.default";
8579
private static final String TEST_CONFIG_MAP_DATA = """
86-
dummy:
87-
property:
88-
profile: default
89-
value: 4
90-
enabled: true
80+
dummy.property.profile=default
81+
dummy.property.value=4
82+
dummy.property.enabled=true
9183
""";
9284

9385
private static final String TEST_SECRET_NAME = "secret.test-cm.default.default";
@@ -102,10 +94,10 @@ abstract class ConfigServerIntegration {
10294
void beforeEach() {
10395
V1ConfigMapList TEST_CONFIGMAP = new V1ConfigMapList().addItemsItem(new V1ConfigMapBuilder().withMetadata(
10496
new V1ObjectMetaBuilder().withName(SOURCE_NAME).withNamespace(NAMESPACE).build())
105-
.addToData(TEST_CONFIG_MAP_DEV_YAML, TEST_CONFIG_MAP_DEV_DATA)
106-
.addToData(TEST_CONFIG_MAP_QA_YAML, TEST_CONFIG_MAP_QA_DATA)
107-
.addToData(TEST_CONFIG_MAP_PROD_YAML, TEST_CONFIG_MAP_PROD_DATA)
108-
.addToData(TEST_CONFIG_MAP_YAML, TEST_CONFIG_MAP_DATA)
97+
.addToData(TEST_CONFIG_MAP_DEV_PROPERTIES, TEST_CONFIG_MAP_DEV_DATA)
98+
.addToData(TEST_CONFIG_MAP_QA_PROPERTIES, TEST_CONFIG_MAP_QA_DATA)
99+
.addToData(TEST_CONFIG_MAP_PROD_PROPERTIES, TEST_CONFIG_MAP_PROD_DATA)
100+
.addToData(TEST_CONFIG_MAP_PROPERTIES, TEST_CONFIG_MAP_DATA)
109101
.addToData("app.name", "test")
110102
.build());
111103

@@ -155,7 +147,7 @@ private void assertTestConfigMapDev(Environment devAndProd) {
155147
@SuppressWarnings("unchecked")
156148
Map<String, Object> data = (Map<String, Object>) testConfigMapDev.getSource();
157149
assertThat(data).containsExactlyInAnyOrderEntriesOf(
158-
Map.of("dummy.property.value", 1, "dummy.property.enabled", false, "dummy.property.profile", "dev"));
150+
Map.of("dummy.property.value", "1", "dummy.property.enabled", "false", "dummy.property.profile", "dev"));
159151
}
160152

161153
private void assertTestConfigMapProd(Environment devAndProd) {
@@ -165,7 +157,7 @@ private void assertTestConfigMapProd(Environment devAndProd) {
165157
@SuppressWarnings("unchecked")
166158
Map<String, Object> data = (Map<String, Object>) testConfigMapProd.getSource();
167159
assertThat(data).containsExactlyInAnyOrderEntriesOf(
168-
Map.of("dummy.property.value", 3, "dummy.property.enabled", true, "dummy.property.profile", "prod"));
160+
Map.of("dummy.property.value", "3", "dummy.property.enabled", "true", "dummy.property.profile", "prod"));
169161
}
170162

171163
private void assertTestConfigMapDefault(Environment devAndProd) {
@@ -175,7 +167,7 @@ private void assertTestConfigMapDefault(Environment devAndProd) {
175167
@SuppressWarnings("unchecked")
176168
Map<String, Object> data = (Map<String, Object>) testConfigMap.getSource();
177169
assertThat(data).containsExactlyInAnyOrderEntriesOf(
178-
Map.of("dummy.property.value", 4, "dummy.property.enabled", true, "dummy.property.profile", "default",
170+
Map.of("dummy.property.value", "4", "dummy.property.enabled", "true", "dummy.property.profile", "default",
179171
"app.name", "test"));
180172
}
181173

@@ -198,7 +190,7 @@ private void assertDefaultProfile(Environment defaultEnv) {
198190
@SuppressWarnings("unchecked")
199191
Map<String, Object> configmapData = (Map<String, Object>) configMapSource.getSource();
200192
assertThat(configmapData).containsExactlyInAnyOrderEntriesOf(
201-
Map.of("dummy.property.value", 4, "dummy.property.enabled", true, "dummy.property.profile", "default",
193+
Map.of("dummy.property.value", "4", "dummy.property.enabled", "true", "dummy.property.profile", "default",
202194
"app.name", "test"));
203195

204196
PropertySource secretSource = defaultEnv.getPropertySources().get(1);

0 commit comments

Comments
 (0)