Skip to content

Commit 8048d49

Browse files
committed
fix
1 parent 2c6895d commit 8048d49

File tree

3 files changed

+24
-18
lines changed

3 files changed

+24
-18
lines changed

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

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@
5858
@ExtendWith(OutputCaptureExtension.class)
5959
class KubernetesClientConfigMapErrorOnReadingSourceTests {
6060

61+
private static final boolean NAMESPACE_BATCHED = true;
62+
6163
private static final V1ConfigMapList SINGLE_CONFIGMAP_LIST = new V1ConfigMapList()
6264
.addItemsItem(new V1ConfigMapBuilder()
6365
.withMetadata(
@@ -113,7 +115,7 @@ void namedSingleConfigMapFails() {
113115
stubFor(get(path).willReturn(aResponse().withStatus(500).withBody("Internal Server Error")));
114116

115117
ConfigMapConfigProperties configMapConfigProperties = new ConfigMapConfigProperties(true, List.of(), List.of(),
116-
Map.of(), true, name, namespace, false, true, false, RetryProperties.DEFAULT, false);
118+
Map.of(), true, name, namespace, false, true, false, RetryProperties.DEFAULT, NAMESPACE_BATCHED);
117119

118120
CoreV1Api api = new CoreV1Api();
119121
KubernetesClientConfigMapPropertySourceLocator locator = new KubernetesClientConfigMapPropertySourceLocator(api,
@@ -159,7 +161,7 @@ void namedTwoConfigMapsOneFails(CapturedOutput output) {
159161

160162
ConfigMapConfigProperties configMapConfigProperties = new ConfigMapConfigProperties(true, List.of(),
161163
List.of(sourceOne, sourceTwo), Map.of(), true, null, namespace, false, true, false,
162-
RetryProperties.DEFAULT, false);
164+
RetryProperties.DEFAULT, NAMESPACE_BATCHED);
163165

164166
CoreV1Api api = new CoreV1Api();
165167
KubernetesClientConfigMapPropertySourceLocator locator = new KubernetesClientConfigMapPropertySourceLocator(api,
@@ -205,7 +207,7 @@ void namedTwoConfigMapsBothFail(CapturedOutput output) {
205207

206208
ConfigMapConfigProperties configMapConfigProperties = new ConfigMapConfigProperties(true, List.of(),
207209
List.of(sourceOne, sourceTwo), Map.of(), true, null, namespace, false, true, false,
208-
RetryProperties.DEFAULT, false);
210+
RetryProperties.DEFAULT, NAMESPACE_BATCHED);
209211

210212
CoreV1Api api = new CoreV1Api();
211213
KubernetesClientConfigMapPropertySourceLocator locator = new KubernetesClientConfigMapPropertySourceLocator(api,
@@ -250,7 +252,7 @@ void labeledSingleConfigMapFails(CapturedOutput output) {
250252

251253
ConfigMapConfigProperties configMapConfigProperties = new ConfigMapConfigProperties(true, List.of(),
252254
List.of(configMapSource), labels, true, null, namespace, false, true, false, RetryProperties.DEFAULT,
253-
false);
255+
NAMESPACE_BATCHED);
254256

255257
CoreV1Api api = new CoreV1Api();
256258
KubernetesClientConfigMapPropertySourceLocator locator = new KubernetesClientConfigMapPropertySourceLocator(api,
@@ -303,7 +305,7 @@ void labeledTwoConfigMapsOneFails(CapturedOutput output) {
303305

304306
ConfigMapConfigProperties configMapConfigProperties = new ConfigMapConfigProperties(true, List.of(),
305307
List.of(sourceOne, sourceTwo), Map.of("one", "1", "two", "2"), true, null, namespace, false, true,
306-
false, RetryProperties.DEFAULT, false);
308+
false, RetryProperties.DEFAULT, NAMESPACE_BATCHED);
307309

308310
CoreV1Api api = new CoreV1Api();
309311
KubernetesClientConfigMapPropertySourceLocator locator = new KubernetesClientConfigMapPropertySourceLocator(api,
@@ -358,7 +360,7 @@ void labeledTwoConfigMapsBothFail(CapturedOutput output) {
358360

359361
ConfigMapConfigProperties configMapConfigProperties = new ConfigMapConfigProperties(true, List.of(),
360362
List.of(sourceOne, sourceTwo), Map.of("one", "1", "two", "2"), true, null, namespace, false, true,
361-
false, RetryProperties.DEFAULT, false);
363+
false, RetryProperties.DEFAULT, NAMESPACE_BATCHED);
362364

363365
CoreV1Api api = new CoreV1Api();
364366
KubernetesClientConfigMapPropertySourceLocator locator = new KubernetesClientConfigMapPropertySourceLocator(api,

spring-cloud-kubernetes-fabric8-config/src/test/java/org/springframework/cloud/kubernetes/fabric8/config/Fabric8ConfigMapErrorOnReadingSourceTests.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@
5050
@ExtendWith(OutputCaptureExtension.class)
5151
class Fabric8ConfigMapErrorOnReadingSourceTests {
5252

53+
private static final boolean NAMESPACED_BATCHED = true;
54+
5355
private static KubernetesMockServer mockServer;
5456

5557
private static KubernetesClient mockClient;
@@ -74,7 +76,7 @@ void namedSingleConfigMapFails() {
7476
mockServer.expect().withPath(path).andReturn(500, "Internal Server Error").once();
7577

7678
ConfigMapConfigProperties configMapConfigProperties = new ConfigMapConfigProperties(true, List.of(), List.of(),
77-
Map.of(), true, name, namespace, false, true, false, RetryProperties.DEFAULT, false);
79+
Map.of(), true, name, namespace, false, true, false, RetryProperties.DEFAULT, NAMESPACED_BATCHED);
7880

7981
Fabric8ConfigMapPropertySourceLocator locator = new Fabric8ConfigMapPropertySourceLocator(mockClient,
8082
configMapConfigProperties, new KubernetesNamespaceProvider(new MockEnvironment()));
@@ -115,7 +117,7 @@ void namedTwoConfigMapsOneFails() {
115117

116118
ConfigMapConfigProperties configMapConfigProperties = new ConfigMapConfigProperties(true, List.of(),
117119
List.of(sourceOne, sourceTwo), Map.of(), true, null, namespace, false, true, false,
118-
RetryProperties.DEFAULT, false);
120+
RetryProperties.DEFAULT, NAMESPACED_BATCHED);
119121

120122
Fabric8ConfigMapPropertySourceLocator locator = new Fabric8ConfigMapPropertySourceLocator(mockClient,
121123
configMapConfigProperties, new KubernetesNamespaceProvider(new MockEnvironment()));
@@ -150,7 +152,7 @@ void namedTwoConfigMapsBothFail() {
150152

151153
ConfigMapConfigProperties configMapConfigProperties = new ConfigMapConfigProperties(true, List.of(),
152154
List.of(sourceOne, sourceTwo), Map.of(), true, null, namespace, false, true, false,
153-
RetryProperties.DEFAULT, false);
155+
RetryProperties.DEFAULT, NAMESPACED_BATCHED);
154156

155157
Fabric8ConfigMapPropertySourceLocator locator = new Fabric8ConfigMapPropertySourceLocator(mockClient,
156158
configMapConfigProperties, new KubernetesNamespaceProvider(new MockEnvironment()));
@@ -183,7 +185,7 @@ void labeledSingleConfigMapFails(CapturedOutput output) {
183185

184186
ConfigMapConfigProperties configMapConfigProperties = new ConfigMapConfigProperties(true, List.of(),
185187
List.of(configMapSource), labels, true, null, namespace, false, true, false, RetryProperties.DEFAULT,
186-
false);
188+
NAMESPACED_BATCHED);
187189

188190
Fabric8ConfigMapPropertySourceLocator locator = new Fabric8ConfigMapPropertySourceLocator(mockClient,
189191
configMapConfigProperties, new KubernetesNamespaceProvider(new MockEnvironment()));
@@ -229,7 +231,7 @@ void labeledTwoConfigMapsOneFails(CapturedOutput output) {
229231

230232
ConfigMapConfigProperties configMapConfigProperties = new ConfigMapConfigProperties(true, List.of(),
231233
List.of(sourceOne, sourceTwo), Map.of("one", "1", "two", "2"), true, null, namespace, false, true,
232-
false, RetryProperties.DEFAULT, false);
234+
false, RetryProperties.DEFAULT, NAMESPACED_BATCHED);
233235

234236
Fabric8ConfigMapPropertySourceLocator locator = new Fabric8ConfigMapPropertySourceLocator(mockClient,
235237
configMapConfigProperties, new KubernetesNamespaceProvider(new MockEnvironment()));
@@ -269,7 +271,7 @@ void labeledTwoConfigMapsBothFail(CapturedOutput output) {
269271

270272
ConfigMapConfigProperties configMapConfigProperties = new ConfigMapConfigProperties(true, List.of(),
271273
List.of(sourceOne, sourceTwo), Map.of("one", "1", "two", "2"), true, null, namespace, false, true,
272-
false, RetryProperties.DEFAULT, false);
274+
false, RetryProperties.DEFAULT, NAMESPACED_BATCHED);
273275

274276
Fabric8ConfigMapPropertySourceLocator locator = new Fabric8ConfigMapPropertySourceLocator(mockClient,
275277
configMapConfigProperties, new KubernetesNamespaceProvider(new MockEnvironment()));

spring-cloud-kubernetes-fabric8-config/src/test/java/org/springframework/cloud/kubernetes/fabric8/config/Fabric8SecretErrorOnReadingSourceTests.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@
5050
@ExtendWith(OutputCaptureExtension.class)
5151
class Fabric8SecretErrorOnReadingSourceTests {
5252

53+
private static final boolean NAMESPACED_BATCHED = true;
54+
5355
private static KubernetesMockServer mockServer;
5456

5557
private static KubernetesClient mockClient;
@@ -74,7 +76,7 @@ void namedSingleSecretFails(CapturedOutput output) {
7476
mockServer.expect().withPath(path).andReturn(500, "Internal Server Error").once();
7577

7678
SecretsConfigProperties secretsConfigProperties = new SecretsConfigProperties(true, Map.of(), List.of(),
77-
List.of(), true, name, namespace, false, true, false, RetryProperties.DEFAULT, false);
79+
List.of(), true, name, namespace, false, true, false, RetryProperties.DEFAULT, NAMESPACED_BATCHED);
7880

7981
Fabric8SecretsPropertySourceLocator locator = new Fabric8SecretsPropertySourceLocator(mockClient,
8082
secretsConfigProperties, new KubernetesNamespaceProvider(new MockEnvironment()));
@@ -114,7 +116,7 @@ void namedTwoSecretsOneFails() {
114116

115117
SecretsConfigProperties secretsConfigProperties = new SecretsConfigProperties(true, Map.of(), List.of(),
116118
List.of(sourceOne, sourceTwo), true, null, namespace, false, true, false, RetryProperties.DEFAULT,
117-
false);
119+
NAMESPACED_BATCHED);
118120

119121
Fabric8SecretsPropertySourceLocator locator = new Fabric8SecretsPropertySourceLocator(mockClient,
120122
secretsConfigProperties, new KubernetesNamespaceProvider(new MockEnvironment()));
@@ -149,7 +151,7 @@ void namedTwoSecretsBothFail() {
149151

150152
SecretsConfigProperties secretsConfigProperties = new SecretsConfigProperties(true, Map.of(), List.of(),
151153
List.of(sourceOne, sourceTwo), true, null, namespace, false, true, false, RetryProperties.DEFAULT,
152-
false);
154+
NAMESPACED_BATCHED);
153155

154156
Fabric8SecretsPropertySourceLocator locator = new Fabric8SecretsPropertySourceLocator(mockClient,
155157
secretsConfigProperties, new KubernetesNamespaceProvider(new MockEnvironment()));
@@ -182,7 +184,7 @@ void labeledSingleSecretFails(CapturedOutput output) {
182184

183185
SecretsConfigProperties secretsConfigProperties = new SecretsConfigProperties(true, labels, List.of(),
184186
List.of(secretSource), true, null, namespace, false, true, false, RetryProperties.DEFAULT,
185-
false);
187+
NAMESPACED_BATCHED);
186188

187189
Fabric8SecretsPropertySourceLocator locator = new Fabric8SecretsPropertySourceLocator(mockClient,
188190
secretsConfigProperties, new KubernetesNamespaceProvider(new MockEnvironment()));
@@ -228,7 +230,7 @@ void labeledTwoSecretsOneFails(CapturedOutput output) {
228230

229231
SecretsConfigProperties secretsConfigProperties = new SecretsConfigProperties(true,
230232
Map.of("one", "1", "two", "2"), List.of(), List.of(sourceOne, sourceTwo), true, null, namespace, false,
231-
true, false, RetryProperties.DEFAULT, false);
233+
true, false, RetryProperties.DEFAULT, NAMESPACED_BATCHED);
232234

233235
Fabric8SecretsPropertySourceLocator locator = new Fabric8SecretsPropertySourceLocator(mockClient,
234236
secretsConfigProperties, new KubernetesNamespaceProvider(new MockEnvironment()));
@@ -268,7 +270,7 @@ void labeledTwoConfigMapsBothFail(CapturedOutput output) {
268270

269271
SecretsConfigProperties secretsConfigProperties = new SecretsConfigProperties(true,
270272
Map.of("one", "1", "two", "2"), List.of(), List.of(sourceOne, sourceTwo), true, null, namespace, false,
271-
true, false, RetryProperties.DEFAULT, false);
273+
true, false, RetryProperties.DEFAULT, NAMESPACED_BATCHED);
272274

273275
Fabric8SecretsPropertySourceLocator locator = new Fabric8SecretsPropertySourceLocator(mockClient,
274276
secretsConfigProperties, new KubernetesNamespaceProvider(new MockEnvironment()));

0 commit comments

Comments
 (0)