Skip to content

Commit eae86bd

Browse files
committed
Merge branch '3.3.x'
2 parents fae4e7f + b1f66f7 commit eae86bd

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

spring-cloud-kubernetes-fabric8-config/src/test/java/org/springframework/cloud/kubernetes/fabric8/config/locator_retry/fail_fast_enabled_retry_disabled/ConfigFailFastEnabledButRetryDisabled.java

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,14 @@
2323

2424
import org.springframework.beans.factory.annotation.Autowired;
2525
import org.springframework.boot.test.context.SpringBootTest;
26+
import org.springframework.boot.test.context.TestConfiguration;
27+
import org.springframework.cloud.kubernetes.commons.KubernetesNamespaceProvider;
28+
import org.springframework.cloud.kubernetes.commons.config.ConfigMapConfigProperties;
2629
import org.springframework.cloud.kubernetes.fabric8.config.Fabric8ConfigMapPropertySourceLocator;
2730
import org.springframework.cloud.kubernetes.fabric8.config.TestApplication;
31+
import org.springframework.cloud.kubernetes.fabric8.config.VisibleFabric8ConfigMapPropertySourceLocator;
2832
import org.springframework.context.ApplicationContext;
33+
import org.springframework.context.annotation.Bean;
2934
import org.springframework.mock.env.MockEnvironment;
3035
import org.springframework.test.context.bean.override.mockito.MockitoSpyBean;
3136

@@ -49,7 +54,7 @@
4954
"spring.cloud.kubernetes.config.fail-fast=true", "spring.cloud.kubernetes.config.retry.enabled=false",
5055
"spring.main.cloud-platform=KUBERNETES", "spring.cloud.kubernetes.config.enabled=false",
5156
"spring.cloud.kubernetes.secrets.enabled=false" },
52-
classes = { TestApplication.class, Fabric8ConfigMapPropertySourceLocator.class })
57+
classes = { TestApplication.class, Fabric8ConfigMapPropertySourceLocator.class, ConfigFailFastEnabledButRetryDisabled.ConfigForTest.class })
5358
abstract class ConfigFailFastEnabledButRetryDisabled {
5459

5560
private static final String API = "/api/v1/namespaces/default/configmaps/application";
@@ -89,4 +94,15 @@ void locateShouldFailWithoutRetrying() {
8994
verify(propertySourceLocator, times(1)).locate(any());
9095
}
9196

97+
@TestConfiguration
98+
static class ConfigForTest {
99+
100+
@Bean
101+
Fabric8ConfigMapPropertySourceLocator propertySourceLocator(KubernetesClient client,
102+
ConfigMapConfigProperties properties, KubernetesNamespaceProvider provider) {
103+
return new VisibleFabric8ConfigMapPropertySourceLocator(client, properties, provider);
104+
}
105+
106+
}
107+
92108
}

0 commit comments

Comments
 (0)