Skip to content

Commit 7a9c6d0

Browse files
committed
Bumping versions
1 parent 581d9e9 commit 7a9c6d0

File tree

1 file changed

+23
-16
lines changed

1 file changed

+23
-16
lines changed

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

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -248,25 +248,32 @@ public void testStoresProfileCase() throws ApiException {
248248
public void testApplicationPropertiesAnSecretsOverride() throws ApiException {
249249
CoreV1Api coreApi = mock(CoreV1Api.class);
250250
when(coreApi.listNamespacedConfigMap(eq("default"), eq(null), eq(null), eq(null), eq(null), eq(null), eq(null),
251-
eq(null), eq(null), eq(null), eq(null))).thenReturn(CONFIGMAP_DEFAULT_LIST);
251+
eq(null), eq(null), eq(null), eq(null))).thenReturn(CONFIGMAP_DEFAULT_LIST);
252252
when(coreApi.listNamespacedSecret(eq("default"), eq(null), eq(null), eq(null), eq(null), eq(null), eq(null),
253-
eq(null), eq(null), eq(null), eq(null))).thenReturn(SECRET_LIST);
253+
eq(null), eq(null), eq(null), eq(null))).thenReturn(SECRET_LIST);
254254
when(coreApi.listNamespacedConfigMap(eq("dev"), eq(null), eq(null), eq(null), eq(null), eq(null), eq(null),
255-
eq(null), eq(null), eq(null), eq(null))).thenReturn(CONFIGMAP_DEV_LIST);
255+
eq(null), eq(null), eq(null), eq(null))).thenReturn(CONFIGMAP_DEV_LIST);
256256
KubernetesEnvironmentRepository environmentRepository = new KubernetesEnvironmentRepository(coreApi,
257-
kubernetesPropertySourceSuppliers, "default");
257+
kubernetesPropertySourceSuppliers, "default");
258258
Environment environment = environmentRepository.findOne("stores-dev", "", "");
259-
environment.getPropertySources().stream().filter(propertySource -> propertySource.getName().startsWith("configmap")).reduce((first, second) -> second).ifPresent(propertySource -> {
260-
assertThat(propertySource.getName()).isEqualTo("configmap.application.default");
261-
});
262-
environment.getPropertySources().stream().filter(propertySource -> propertySource.getName().startsWith("configmap")).findFirst().ifPresent(propertySource -> {
263-
assertThat(propertySource.getSource().get("dummy.property.int2")).isEqualTo(2);
264-
assertThat(propertySource.getSource().get("dummy.property.bool2")).isEqualTo(false);
265-
assertThat(propertySource.getSource().get("dummy.property.string2")).isEqualTo("b");
266-
});
267-
environment.getPropertySources().stream().filter(propertySource -> propertySource.getName().startsWith("secrets")).findFirst().ifPresent(propertySource -> {
268-
assertThat(propertySource.getSource().get("username")).isEqualTo("stores-dev");
269-
assertThat(propertySource.getSource().get("password")).isEqualTo("p455w0rd");
270-
});
259+
environment.getPropertySources().stream()
260+
.filter(propertySource -> propertySource.getName().startsWith("configmap"))
261+
.reduce((first, second) -> second).ifPresent(propertySource -> {
262+
assertThat(propertySource.getName()).isEqualTo("configmap.application.default");
263+
});
264+
environment.getPropertySources().stream()
265+
.filter(propertySource -> propertySource.getName().startsWith("configmap")).findFirst()
266+
.ifPresent(propertySource -> {
267+
assertThat(propertySource.getSource().get("dummy.property.int2")).isEqualTo(2);
268+
assertThat(propertySource.getSource().get("dummy.property.bool2")).isEqualTo(false);
269+
assertThat(propertySource.getSource().get("dummy.property.string2")).isEqualTo("b");
270+
});
271+
environment.getPropertySources().stream()
272+
.filter(propertySource -> propertySource.getName().startsWith("secrets")).findFirst()
273+
.ifPresent(propertySource -> {
274+
assertThat(propertySource.getSource().get("username")).isEqualTo("stores-dev");
275+
assertThat(propertySource.getSource().get("password")).isEqualTo("p455w0rd");
276+
});
271277
}
278+
272279
}

0 commit comments

Comments
 (0)