diff --git a/spring-cloud-netflix-eureka-client/src/test/java/org/springframework/cloud/netflix/eureka/ConditionalOnRefreshScopeTests.java b/spring-cloud-netflix-eureka-client/src/test/java/org/springframework/cloud/netflix/eureka/ConditionalOnRefreshScopeTests.java index 2afeebc7a..93487293c 100644 --- a/spring-cloud-netflix-eureka-client/src/test/java/org/springframework/cloud/netflix/eureka/ConditionalOnRefreshScopeTests.java +++ b/spring-cloud-netflix-eureka-client/src/test/java/org/springframework/cloud/netflix/eureka/ConditionalOnRefreshScopeTests.java @@ -43,6 +43,18 @@ public class ConditionalOnRefreshScopeTests { }); } + @Test + public void refreshScopeIncludedAndPropertyDisabled() { + new ApplicationContextRunner() + .withConfiguration(AutoConfigurations.of(RefreshAutoConfiguration.class)) + .withPropertyValues("eureka.client.refresh.enable=false") + .withUserConfiguration(Beans.class).run(c -> { + assertThat(c).hasSingleBean( + org.springframework.cloud.context.scope.refresh.RefreshScope.class); + assertThat(c).doesNotHaveBean("foo"); + }); + } + @Test public void refreshScopeNotIncluded() { new ApplicationContextRunner().withUserConfiguration(Beans.class).run(c -> { @@ -59,4 +71,4 @@ public class ConditionalOnRefreshScopeTests { } } -} \ No newline at end of file +}