本文整理汇总了Java中org.springframework.cloud.bootstrap.config.PropertySourceBootstrapConfiguration类的典型用法代码示例。如果您正苦于以下问题:Java PropertySourceBootstrapConfiguration类的具体用法?Java PropertySourceBootstrapConfiguration怎么用?Java PropertySourceBootstrapConfiguration使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PropertySourceBootstrapConfiguration类属于org.springframework.cloud.bootstrap.config包,在下文中一共展示了PropertySourceBootstrapConfiguration类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getLoadedCloudPropertySource
import org.springframework.cloud.bootstrap.config.PropertySourceBootstrapConfiguration; //导入依赖的package包/类
/**
* 获取加载的Cloud Config 配置项
*
* @param propertySources
* @return
*/
private PropertySource getLoadedCloudPropertySource(MutablePropertySources propertySources) {
if (!propertySources.contains(PropertySourceBootstrapConfiguration.BOOTSTRAP_PROPERTY_SOURCE_NAME)) {
return null;
}
PropertySource propertySource = propertySources.get(PropertySourceBootstrapConfiguration.BOOTSTRAP_PROPERTY_SOURCE_NAME);
if (propertySource instanceof CompositePropertySource) {
for (PropertySource<?> source : ((CompositePropertySource) propertySource).getPropertySources()) {
if (source.getName().equals("configService")) {
return source;
}
}
}
return null;
}
示例2: withHealthIndicator
import org.springframework.cloud.bootstrap.config.PropertySourceBootstrapConfiguration; //导入依赖的package包/类
@Test
public void withHealthIndicator() {
ConfigurableApplicationContext context = new SpringApplicationBuilder(
PropertySourceBootstrapConfiguration.class, ConfigServiceBootstrapConfiguration.class)
.child(ConfigClientAutoConfiguration.class).web(WebApplicationType.NONE).run();
assertEquals(1, BeanFactoryUtils.beanNamesForTypeIncludingAncestors(context,
ConfigClientProperties.class).length);
assertEquals(1, BeanFactoryUtils.beanNamesForTypeIncludingAncestors(context,
ConfigServerHealthIndicator.class).length);
context.close();
}
开发者ID:spring-cloud,项目名称:spring-cloud-config,代码行数:12,代码来源:ConfigServerBootstrapConfigurationTests.java
示例3: bootstrapPropertiesExist
import org.springframework.cloud.bootstrap.config.PropertySourceBootstrapConfiguration; //导入依赖的package包/类
@Test
@Ignore //FIXME: spring boot 2.0.0
public void bootstrapPropertiesExist() {
assertTrue(this.environment.getPropertySources().contains(
PropertySourceBootstrapConfiguration.BOOTSTRAP_PROPERTY_SOURCE_NAME));
}
开发者ID:spring-cloud,项目名称:spring-cloud-commons,代码行数:7,代码来源:BootstrapOrderingAutoConfigurationIntegrationTests.java