Commit 04c72a45 by Johannes Edmeier

Merge remote-tracking branch 'upstream/master' into 2.x

parents d1ed8b78 8143743d
...@@ -45,6 +45,7 @@ import static org.springframework.boot.autoconfigure.condition.ConditionalOnWebA ...@@ -45,6 +45,7 @@ import static org.springframework.boot.autoconfigure.condition.ConditionalOnWebA
@Configuration @Configuration
@EnableConfigurationProperties({ClientProperties.class, InstanceProperties.class}) @EnableConfigurationProperties({ClientProperties.class, InstanceProperties.class})
@ConditionalOnWebApplication
@Conditional(SpringBootAdminClientEnabledCondition.class) @Conditional(SpringBootAdminClientEnabledCondition.class)
@AutoConfigureAfter(WebMvcEndpointManagementContextConfiguration.class) @AutoConfigureAfter(WebMvcEndpointManagementContextConfiguration.class)
public class SpringBootAdminClientAutoConfiguration { public class SpringBootAdminClientAutoConfiguration {
......
...@@ -40,6 +40,13 @@ public class SpringBootAdminClientAutoConfigurationTest { ...@@ -40,6 +40,13 @@ public class SpringBootAdminClientAutoConfigurationTest {
assertThat(context.getBeansOfType(ApplicationRegistrator.class)).isEmpty(); assertThat(context.getBeansOfType(ApplicationRegistrator.class)).isEmpty();
} }
@Test
public void nonWebEnvironment() {
load("spring.main.admin.url:http://localhost:8081", "spring.boot.admin.client.enabled:true",
"spring.main.web-environment:false");
assertThat(context.getBeansOfType(ApplicationRegistrator.class).isEmpty());
}
private void load(final String... environment) { private void load(final String... environment) {
SpringApplication springApplication = new SpringApplication(TestClientApplication.class); SpringApplication springApplication = new SpringApplication(TestClientApplication.class);
springApplication.addInitializers( springApplication.addInitializers(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment