org.springframework.cloud.config.server.config.ConfigServerProperties Java Examples

The following examples show how to use org.springframework.cloud.config.server.config.ConfigServerProperties. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: EurekaClientConfigServerAutoConfigurationTests.java    From spring-cloud-netflix with Apache License 2.0 6 votes vote down vote up
@Test
public void notOverridingMetamapSettings() {
	new ApplicationContextRunner()
			.withConfiguration(AutoConfigurations.of(
					EurekaClientConfigServerAutoConfiguration.class,
					ConfigServerProperties.class, EurekaInstanceConfigBean.class))
			.withPropertyValues("spring.cloud.config.server.prefix=/config")
			.withPropertyValues(
					"eureka.instance.metadataMap.configPath=/differentpath")
			.run(c -> {
				assertThat(c.getBeanNamesForType(EurekaInstanceConfig.class).length)
						.isEqualTo(1);
				EurekaInstanceConfig instance = c.getBean(EurekaInstanceConfig.class);
				assertThat(instance.getMetadataMap().get("configPath"))
						.isEqualTo("/differentpath");
			});
}
 
Example #2
Source File: NativeEnvironmentRepositoryFactoryTest.java    From spring-cloud-config with Apache License 2.0 6 votes vote down vote up
@Test
public void testDefaultLabel() {
	ConfigServerProperties props = new ConfigServerProperties();
	props.setDefaultLabel("mylabel");
	NativeEnvironmentRepositoryFactory factory = new NativeEnvironmentRepositoryFactory(
			new StandardEnvironment(), props);
	NativeEnvironmentProperties environmentProperties = new NativeEnvironmentProperties();
	NativeEnvironmentRepository repo = factory.build(environmentProperties);
	assertThat(repo.getDefaultLabel()).isEqualTo("mylabel");

	factory = new NativeEnvironmentRepositoryFactory(new StandardEnvironment(),
			props);
	environmentProperties = new NativeEnvironmentProperties();
	environmentProperties.setDefaultLabel("mynewlabel");
	repo = factory.build(environmentProperties);
	assertThat(repo.getDefaultLabel()).isEqualTo("mylabel");

	factory = new NativeEnvironmentRepositoryFactory(new StandardEnvironment(),
			new ConfigServerProperties());
	environmentProperties = new NativeEnvironmentProperties();
	environmentProperties.setDefaultLabel("mynewlabel");
	repo = factory.build(environmentProperties);
	assertThat(repo.getDefaultLabel()).isEqualTo("mynewlabel");
}
 
Example #3
Source File: ZookeeperConfigServerAutoConfigurationTests.java    From spring-cloud-zookeeper with Apache License 2.0 5 votes vote down vote up
private void setup(String... env) {
	this.context = new SpringApplicationBuilder(
			PropertyPlaceholderAutoConfiguration.class,
			ZookeeperConfigServerAutoConfiguration.class,
			ConfigServerProperties.class, ZookeeperDiscoveryProperties.class)
					.web(WebApplicationType.NONE).properties(env).run();
}
 
Example #4
Source File: EurekaClientConfigServerAutoConfigurationTests.java    From spring-cloud-netflix with Apache License 2.0 5 votes vote down vote up
@Test
public void onWhenRequested() {
	new ApplicationContextRunner()
			.withConfiguration(AutoConfigurations.of(
					EurekaClientConfigServerAutoConfiguration.class,
					ConfigServerProperties.class, EurekaInstanceConfigBean.class))
			.withPropertyValues("spring.cloud.config.server.prefix=/config")
			.run(c -> {
				assertThat(c.getBeanNamesForType(EurekaInstanceConfig.class).length)
						.isEqualTo(1);
				EurekaInstanceConfig instance = c.getBean(EurekaInstanceConfig.class);
				assertThat(instance.getMetadataMap().get("configPath"))
						.isEqualTo("/config");
			});
}
 
Example #5
Source File: MultipleJGitEnvironmentRepositoryFactory.java    From spring-cloud-config with Apache License 2.0 5 votes vote down vote up
public MultipleJGitEnvironmentRepositoryFactory(ConfigurableEnvironment environment,
		ConfigServerProperties server,
		Optional<ConfigurableHttpConnectionFactory> connectionFactory,
		TransportConfigCallbackFactory transportConfigCallbackFactory) {
	this.environment = environment;
	this.server = server;
	this.connectionFactory = connectionFactory;
	this.transportConfigCallbackFactory = transportConfigCallbackFactory;
}
 
Example #6
Source File: ConsulConfigServerAutoConfigurationTests.java    From spring-cloud-consul with Apache License 2.0 5 votes vote down vote up
private void setup(String... env) {
	this.context = new SpringApplicationBuilder(
			PropertyPlaceholderAutoConfiguration.class,
			ConsulConfigServerAutoConfiguration.class, ConfigServerProperties.class,
			ConsulDiscoveryProperties.class).web(WebApplicationType.NONE)
					.properties(env).run();
}
 
Example #7
Source File: MultipleJGitEnvironmentRepositoryFactory.java    From spring-cloud-config with Apache License 2.0 4 votes vote down vote up
@Deprecated
public MultipleJGitEnvironmentRepositoryFactory(ConfigurableEnvironment environment,
		ConfigServerProperties server,
		TransportConfigCallbackFactory transportConfigCallbackFactory) {
	this(environment, server, Optional.empty(), transportConfigCallbackFactory);
}
 
Example #8
Source File: NativeEnvironmentRepositoryFactory.java    From spring-cloud-config with Apache License 2.0 4 votes vote down vote up
public NativeEnvironmentRepositoryFactory(ConfigurableEnvironment environment,
		ConfigServerProperties properties) {
	this.environment = environment;
	this.properties = properties;
}
 
Example #9
Source File: AwsS3EnvironmentRepository.java    From spring-cloud-config with Apache License 2.0 4 votes vote down vote up
public AwsS3EnvironmentRepository(AmazonS3 s3Client, String bucketName,
		ConfigServerProperties server) {
	this.s3Client = s3Client;
	this.bucketName = bucketName;
	this.serverProperties = server;
}
 
Example #10
Source File: AwsS3EnvironmentRepositoryFactory.java    From spring-cloud-config with Apache License 2.0 4 votes vote down vote up
public AwsS3EnvironmentRepositoryFactory(ConfigServerProperties server) {
	this.server = server;
}
 
Example #11
Source File: SvnEnvironmentRepositoryFactory.java    From spring-cloud-config with Apache License 2.0 4 votes vote down vote up
public SvnEnvironmentRepositoryFactory(ConfigurableEnvironment environment,
		ConfigServerProperties server) {
	this.environment = environment;
	this.server = server;
}