本文整理匯總了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