From 04c2bba3db1c0c62d5439a719571cc0521f84e57 Mon Sep 17 00:00:00 2001 From: Dave Syer Date: Mon, 16 Jun 2014 14:16:00 +0100 Subject: [PATCH] Add RefreshEndpoint --- .../RefreshAutoConfiguration.java | 11 ++ .../BootstrapApplicationListener.java | 19 +++ .../ConfigServiceBootstrapConfiguration.java | 18 ++- .../{bootstrap => }/config/Environment.java | 2 +- .../config/PropertySource.java | 2 +- .../ConfigServicePropertySourceLocator.java | 6 +- .../client}/PropertySourceLocator.java | 2 +- .../config/client/RefreshEndpoint.java | 122 ++++++++++++++++++ .../BootstrapConfigurationTests.java | 2 +- .../src/main/resources/logback.xml | 6 + .../test/java/sample/ApplicationTests.java | 16 ++- .../src/test/resources/server.yml | 9 ++ .../platform/config/server/Application.java | 2 +- .../config/server/EnvironmentRepository.java | 2 +- .../server/JGitEnvironmentRepository.java | 4 +- .../server/NativeEnvironmentRepository.java | 4 +- ...pringApplicationEnvironmentRepository.java | 2 +- .../src/main/resources/application.yml | 4 +- .../config/server/ApplicationTests.java | 2 +- .../JGitEnvironmentRepositoryTests.java | 2 +- ...ApplicationEnvironmentRepositoryTests.java | 2 +- 21 files changed, 218 insertions(+), 21 deletions(-) rename spring-platform-config-client/src/main/java/org/springframework/platform/{bootstrap => }/config/Environment.java (96%) rename spring-platform-config-client/src/main/java/org/springframework/platform/{bootstrap => }/config/PropertySource.java (95%) rename spring-platform-config-client/src/main/java/org/springframework/platform/{bootstrap/config => config/client}/ConfigServicePropertySourceLocator.java (88%) rename spring-platform-config-client/src/main/java/org/springframework/platform/{bootstrap/config => config/client}/PropertySourceLocator.java (93%) create mode 100644 spring-platform-config-client/src/main/java/org/springframework/platform/config/client/RefreshEndpoint.java create mode 100644 spring-platform-config-sample/src/main/resources/logback.xml create mode 100644 spring-platform-config-sample/src/test/resources/server.yml diff --git a/spring-platform-config-client/src/main/java/org/springframework/platform/autoconfigure/RefreshAutoConfiguration.java b/spring-platform-config-client/src/main/java/org/springframework/platform/autoconfigure/RefreshAutoConfiguration.java index 075aaece..9b240621 100644 --- a/spring-platform-config-client/src/main/java/org/springframework/platform/autoconfigure/RefreshAutoConfiguration.java +++ b/spring-platform-config-client/src/main/java/org/springframework/platform/autoconfigure/RefreshAutoConfiguration.java @@ -27,9 +27,12 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; import org.springframework.boot.context.properties.ConfigurationBeanFactoryMetaData; import org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor; +import org.springframework.context.ConfigurableApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.env.ConfigurableEnvironment; +import org.springframework.platform.bootstrap.config.ConfigServiceBootstrapConfiguration; +import org.springframework.platform.config.client.RefreshEndpoint; import org.springframework.platform.context.environment.EnvironmentManager; import org.springframework.platform.context.environment.EnvironmentManagerMvcEndpoint; import org.springframework.platform.context.properties.ConfigurationPropertiesRebinder; @@ -66,6 +69,14 @@ public class RefreshAutoConfiguration { return rebinder; } + @Bean + @ConditionalOnMissingBean + @ConditionalOnExpression("${endpoints.refresh.enabled:true}") + public RefreshEndpoint refreshEndpoint(ConfigurableApplicationContext context, ConfigServiceBootstrapConfiguration bootstrap) { + RefreshEndpoint endpoint = new RefreshEndpoint(context, bootstrap); + return endpoint; + } + @Configuration @ConditionalOnWebApplication @ConditionalOnClass(EnvironmentEndpoint.class) diff --git a/spring-platform-config-client/src/main/java/org/springframework/platform/bootstrap/BootstrapApplicationListener.java b/spring-platform-config-client/src/main/java/org/springframework/platform/bootstrap/BootstrapApplicationListener.java index 50d8d709..21737293 100644 --- a/spring-platform-config-client/src/main/java/org/springframework/platform/bootstrap/BootstrapApplicationListener.java +++ b/spring-platform-config-client/src/main/java/org/springframework/platform/bootstrap/BootstrapApplicationListener.java @@ -106,6 +106,7 @@ public class BootstrapApplicationListener implements context.close(); } }); + application.addInitializers(new AncestorInitializer(context)); return context; } @@ -134,5 +135,23 @@ public class BootstrapApplicationListener implements public int getOrder() { return this.order; } + + private static class AncestorInitializer implements ApplicationContextInitializer { + + private ConfigurableApplicationContext parent; + + public AncestorInitializer(ConfigurableApplicationContext parent) { + this.parent = parent; + } + + @Override + public void initialize(ConfigurableApplicationContext context) { + while (context.getParent()!=null) { + context = (ConfigurableApplicationContext) context.getParent(); + } + context.setParent(parent); + } + + } } diff --git a/spring-platform-config-client/src/main/java/org/springframework/platform/bootstrap/config/ConfigServiceBootstrapConfiguration.java b/spring-platform-config-client/src/main/java/org/springframework/platform/bootstrap/config/ConfigServiceBootstrapConfiguration.java index 0311389e..01c65d9b 100644 --- a/spring-platform-config-client/src/main/java/org/springframework/platform/bootstrap/config/ConfigServiceBootstrapConfiguration.java +++ b/spring-platform-config-client/src/main/java/org/springframework/platform/bootstrap/config/ConfigServiceBootstrapConfiguration.java @@ -17,12 +17,12 @@ package org.springframework.platform.bootstrap.config; import java.util.ArrayList; +import java.util.Collection; import java.util.List; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.ApplicationContextInitializer; import org.springframework.context.ConfigurableApplicationContext; @@ -30,7 +30,10 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.annotation.AnnotationAwareOrderComparator; import org.springframework.core.env.CompositePropertySource; +import org.springframework.core.env.MutablePropertySources; import org.springframework.core.env.PropertySource; +import org.springframework.platform.config.client.ConfigServicePropertySourceLocator; +import org.springframework.platform.config.client.PropertySourceLocator; /** * @author Dave Syer @@ -45,6 +48,11 @@ public class ConfigServiceBootstrapConfiguration implements @Autowired(required = false) private List propertySourceLocators = new ArrayList(); + + public void setPropertySourceLocators( + Collection propertySourceLocators) { + this.propertySourceLocators = new ArrayList(propertySourceLocators); + } @Override public void initialize(ConfigurableApplicationContext applicationContext) { @@ -66,12 +74,16 @@ public class ConfigServiceBootstrapConfiguration implements empty = false; } if (!empty) { - applicationContext.getEnvironment().getPropertySources().addFirst(composite); + MutablePropertySources propertySources = applicationContext.getEnvironment().getPropertySources(); + if (propertySources.contains("bootstrap")) { + propertySources.replace("bootstrap", composite); + } else { + propertySources.addFirst(composite); + } } } @Bean - @ConfigurationProperties("spring.platform.config") public ConfigServicePropertySourceLocator configServicePropertySource() { return new ConfigServicePropertySourceLocator(); } diff --git a/spring-platform-config-client/src/main/java/org/springframework/platform/bootstrap/config/Environment.java b/spring-platform-config-client/src/main/java/org/springframework/platform/config/Environment.java similarity index 96% rename from spring-platform-config-client/src/main/java/org/springframework/platform/bootstrap/config/Environment.java rename to spring-platform-config-client/src/main/java/org/springframework/platform/config/Environment.java index 587a3d88..e3ad1b5c 100644 --- a/spring-platform-config-client/src/main/java/org/springframework/platform/bootstrap/config/Environment.java +++ b/spring-platform-config-client/src/main/java/org/springframework/platform/config/Environment.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.platform.bootstrap.config; +package org.springframework.platform.config; import java.util.ArrayList; import java.util.List; diff --git a/spring-platform-config-client/src/main/java/org/springframework/platform/bootstrap/config/PropertySource.java b/spring-platform-config-client/src/main/java/org/springframework/platform/config/PropertySource.java similarity index 95% rename from spring-platform-config-client/src/main/java/org/springframework/platform/bootstrap/config/PropertySource.java rename to spring-platform-config-client/src/main/java/org/springframework/platform/config/PropertySource.java index a98b62b1..5ecb04e2 100644 --- a/spring-platform-config-client/src/main/java/org/springframework/platform/bootstrap/config/PropertySource.java +++ b/spring-platform-config-client/src/main/java/org/springframework/platform/config/PropertySource.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.platform.bootstrap.config; +package org.springframework.platform.config; import java.util.Map; diff --git a/spring-platform-config-client/src/main/java/org/springframework/platform/bootstrap/config/ConfigServicePropertySourceLocator.java b/spring-platform-config-client/src/main/java/org/springframework/platform/config/client/ConfigServicePropertySourceLocator.java similarity index 88% rename from spring-platform-config-client/src/main/java/org/springframework/platform/bootstrap/config/ConfigServicePropertySourceLocator.java rename to spring-platform-config-client/src/main/java/org/springframework/platform/config/client/ConfigServicePropertySourceLocator.java index c99e767b..2e4149bb 100644 --- a/spring-platform-config-client/src/main/java/org/springframework/platform/bootstrap/config/ConfigServicePropertySourceLocator.java +++ b/spring-platform-config-client/src/main/java/org/springframework/platform/config/client/ConfigServicePropertySourceLocator.java @@ -14,21 +14,25 @@ * limitations under the License. */ -package org.springframework.platform.bootstrap.config; +package org.springframework.platform.config.client; import java.util.Map; import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.core.env.CompositePropertySource; import org.springframework.core.env.MapPropertySource; import org.springframework.http.HttpEntity; import org.springframework.http.HttpMethod; +import org.springframework.platform.config.Environment; +import org.springframework.platform.config.PropertySource; import org.springframework.web.client.RestTemplate; /** * @author Dave Syer * */ +@ConfigurationProperties("spring.platform.config") public class ConfigServicePropertySourceLocator implements PropertySourceLocator { private String env = "development"; diff --git a/spring-platform-config-client/src/main/java/org/springframework/platform/bootstrap/config/PropertySourceLocator.java b/spring-platform-config-client/src/main/java/org/springframework/platform/config/client/PropertySourceLocator.java similarity index 93% rename from spring-platform-config-client/src/main/java/org/springframework/platform/bootstrap/config/PropertySourceLocator.java rename to spring-platform-config-client/src/main/java/org/springframework/platform/config/client/PropertySourceLocator.java index fc4cf294..c5681b8d 100644 --- a/spring-platform-config-client/src/main/java/org/springframework/platform/bootstrap/config/PropertySourceLocator.java +++ b/spring-platform-config-client/src/main/java/org/springframework/platform/config/client/PropertySourceLocator.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.platform.bootstrap.config; +package org.springframework.platform.config.client; import org.springframework.core.env.PropertySource; diff --git a/spring-platform-config-client/src/main/java/org/springframework/platform/config/client/RefreshEndpoint.java b/spring-platform-config-client/src/main/java/org/springframework/platform/config/client/RefreshEndpoint.java new file mode 100644 index 00000000..32e7e341 --- /dev/null +++ b/spring-platform-config-client/src/main/java/org/springframework/platform/config/client/RefreshEndpoint.java @@ -0,0 +1,122 @@ +/* + * Copyright 2013-2014 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.platform.config.client; + +import java.lang.reflect.Field; +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; +import java.util.Set; + +import org.springframework.boot.actuate.endpoint.AbstractEndpoint; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.ConfigurableApplicationContext; +import org.springframework.core.env.CompositePropertySource; +import org.springframework.core.env.EnumerablePropertySource; +import org.springframework.core.env.MutablePropertySources; +import org.springframework.core.env.PropertySource; +import org.springframework.platform.bootstrap.config.ConfigServiceBootstrapConfiguration; +import org.springframework.platform.context.environment.EnvironmentChangeEvent; +import org.springframework.util.ReflectionUtils; + +/** + * @author Dave Syer + * + */ +@ConfigurationProperties(prefix = "endpoints.refresh", ignoreUnknownFields = false) +public class RefreshEndpoint extends AbstractEndpoint> { + + private ConfigurableApplicationContext context; + + private ConfigServiceBootstrapConfiguration bootstrap = new ConfigServiceBootstrapConfiguration(); + + public RefreshEndpoint(ConfigurableApplicationContext context, ConfigServiceBootstrapConfiguration bootstrap) { + super("refresh"); + this.context = context; + this.bootstrap = bootstrap; + } + + @Override + public Collection invoke() { + Map before = extract(context.getEnvironment().getPropertySources()); + bootstrap.initialize(context); + Set keys = changes(before, + extract(context.getEnvironment().getPropertySources())).keySet(); + if (keys.isEmpty()) { + return keys; + } + context.publishEvent(new EnvironmentChangeEvent(keys)); + return keys; + } + + private Map changes(Map before, + Map after) { + Map result = new HashMap(); + for (String key : before.keySet()) { + if (!after.containsKey(key)) { + result.put(key, null); + } else if (!equal(before.get(key), after.get(key))) { + result.put(key, after.get(key)); + } + } + for (String key : after.keySet()) { + if (!before.containsKey(key)) { + result.put(key, after.get(key)); + } + } + return result; + } + + private boolean equal(Object one, Object two) { + if (one == null && two == null) { + return true; + } + if (one == null || two == null) { + return false; + } + return one.equals(two); + } + + private Map extract(MutablePropertySources propertySources) { + Map result = new HashMap(); + PropertySource parent = propertySources.get("bootstrap"); + extract(parent, result); + return result; + } + + private void extract(PropertySource parent, Map result) { + if (parent instanceof CompositePropertySource) { + try { + Field field = ReflectionUtils.findField(CompositePropertySource.class, + "propertySources"); + field.setAccessible(true); + @SuppressWarnings("unchecked") + Set> sources = (Set>) field.get(parent); + for (PropertySource source : sources) { + extract(source, result); + } + } catch (Exception e) { + return; + } + } else if (parent instanceof EnumerablePropertySource) { + for (String key : ((EnumerablePropertySource) parent).getPropertyNames()) { + result.put(key, parent.getProperty(key)); + } + } + } + +} diff --git a/spring-platform-config-client/src/test/java/org/springframework/platform/bootstrap/BootstrapConfigurationTests.java b/spring-platform-config-client/src/test/java/org/springframework/platform/bootstrap/BootstrapConfigurationTests.java index 1dfbbcb3..5fd16cef 100644 --- a/spring-platform-config-client/src/test/java/org/springframework/platform/bootstrap/BootstrapConfigurationTests.java +++ b/spring-platform-config-client/src/test/java/org/springframework/platform/bootstrap/BootstrapConfigurationTests.java @@ -31,7 +31,7 @@ import org.springframework.core.env.ConfigurableEnvironment; import org.springframework.core.env.MapPropertySource; import org.springframework.core.env.PropertySource; import org.springframework.core.env.StandardEnvironment; -import org.springframework.platform.bootstrap.config.PropertySourceLocator; +import org.springframework.platform.config.client.PropertySourceLocator; /** * @author Dave Syer diff --git a/spring-platform-config-sample/src/main/resources/logback.xml b/spring-platform-config-sample/src/main/resources/logback.xml new file mode 100644 index 00000000..df17a071 --- /dev/null +++ b/spring-platform-config-sample/src/main/resources/logback.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/spring-platform-config-sample/src/test/java/sample/ApplicationTests.java b/spring-platform-config-sample/src/test/java/sample/ApplicationTests.java index e6d3ef3c..06db287e 100644 --- a/spring-platform-config-sample/src/test/java/sample/ApplicationTests.java +++ b/spring-platform-config-sample/src/test/java/sample/ApplicationTests.java @@ -21,14 +21,14 @@ import org.springframework.test.context.web.WebAppConfiguration; @WebAppConfiguration public class ApplicationTests { - private static int configPort; + private static int configPort = 0; @Value("${local.server.port}") private int port; @BeforeClass public static void startConfigServer() { - ConfigurableApplicationContext context = SpringApplication.run(org.springframework.platform.config.server.Application.class, "--server.port=0"); + ConfigurableApplicationContext context = SpringApplication.run(org.springframework.platform.config.server.Application.class, "--server.port=" + configPort, "--spring.config.name=server"); configPort = ((EmbeddedWebApplicationContext)context).getEmbeddedServletContainer().getPort(); System.setProperty("config.port", "" + configPort); } @@ -38,5 +38,17 @@ public class ApplicationTests { String foo = new TestRestTemplate().getForObject("http://localhost:" + port + "/env/foo", String.class); assertEquals("bar", foo); } + + public static void main(String[] args) { + System.setProperty("spring.jmx.default_domain", "platform.config.server"); + System.setProperty("endpoints.jmx.domain", "platform.config.server"); + System.setProperty("spring.platform.config.server.basedir", "target/config"); + configPort = 8888; + startConfigServer(); + System.clearProperty("spring.jmx.default_domain"); + System.clearProperty("endpoints.jmx.domain"); + System.clearProperty("spring.platform.config.server.basedir"); + SpringApplication.run(Application.class, args); + } } diff --git a/spring-platform-config-sample/src/test/resources/server.yml b/spring-platform-config-sample/src/test/resources/server.yml new file mode 100644 index 00000000..028b47e4 --- /dev/null +++ b/spring-platform-config-sample/src/test/resources/server.yml @@ -0,0 +1,9 @@ +info: + component: Config Server +spring: + application: + name: configserver +server: + port: 8888 +management: + contextPath: /admin \ No newline at end of file diff --git a/spring-platform-config-server/src/main/java/org/springframework/platform/config/server/Application.java b/spring-platform-config-server/src/main/java/org/springframework/platform/config/server/Application.java index 222129b7..59a2ed6a 100644 --- a/spring-platform-config-server/src/main/java/org/springframework/platform/config/server/Application.java +++ b/spring-platform-config-server/src/main/java/org/springframework/platform/config/server/Application.java @@ -10,7 +10,7 @@ import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; import org.springframework.core.env.ConfigurableEnvironment; -import org.springframework.platform.bootstrap.config.Environment; +import org.springframework.platform.config.Environment; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; diff --git a/spring-platform-config-server/src/main/java/org/springframework/platform/config/server/EnvironmentRepository.java b/spring-platform-config-server/src/main/java/org/springframework/platform/config/server/EnvironmentRepository.java index e0ac1ab7..67ce6ff1 100644 --- a/spring-platform-config-server/src/main/java/org/springframework/platform/config/server/EnvironmentRepository.java +++ b/spring-platform-config-server/src/main/java/org/springframework/platform/config/server/EnvironmentRepository.java @@ -15,7 +15,7 @@ */ package org.springframework.platform.config.server; -import org.springframework.platform.bootstrap.config.Environment; +import org.springframework.platform.config.Environment; /** diff --git a/spring-platform-config-server/src/main/java/org/springframework/platform/config/server/JGitEnvironmentRepository.java b/spring-platform-config-server/src/main/java/org/springframework/platform/config/server/JGitEnvironmentRepository.java index efe96c6d..9101c1d9 100644 --- a/spring-platform-config-server/src/main/java/org/springframework/platform/config/server/JGitEnvironmentRepository.java +++ b/spring-platform-config-server/src/main/java/org/springframework/platform/config/server/JGitEnvironmentRepository.java @@ -24,8 +24,8 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.eclipse.jgit.api.Git; import org.eclipse.jgit.util.FileUtils; -import org.springframework.platform.bootstrap.config.Environment; -import org.springframework.platform.bootstrap.config.PropertySource; +import org.springframework.platform.config.Environment; +import org.springframework.platform.config.PropertySource; import org.springframework.util.Assert; /** diff --git a/spring-platform-config-server/src/main/java/org/springframework/platform/config/server/NativeEnvironmentRepository.java b/spring-platform-config-server/src/main/java/org/springframework/platform/config/server/NativeEnvironmentRepository.java index 6085e568..2cc33132 100644 --- a/spring-platform-config-server/src/main/java/org/springframework/platform/config/server/NativeEnvironmentRepository.java +++ b/spring-platform-config-server/src/main/java/org/springframework/platform/config/server/NativeEnvironmentRepository.java @@ -24,8 +24,8 @@ import java.util.Set; import org.springframework.core.env.ConfigurableEnvironment; import org.springframework.core.env.MapPropertySource; import org.springframework.core.env.StandardEnvironment; -import org.springframework.platform.bootstrap.config.Environment; -import org.springframework.platform.bootstrap.config.PropertySource; +import org.springframework.platform.config.Environment; +import org.springframework.platform.config.PropertySource; import org.springframework.web.context.support.StandardServletEnvironment; /** diff --git a/spring-platform-config-server/src/main/java/org/springframework/platform/config/server/SpringApplicationEnvironmentRepository.java b/spring-platform-config-server/src/main/java/org/springframework/platform/config/server/SpringApplicationEnvironmentRepository.java index a687b5cb..ad7c7365 100644 --- a/spring-platform-config-server/src/main/java/org/springframework/platform/config/server/SpringApplicationEnvironmentRepository.java +++ b/spring-platform-config-server/src/main/java/org/springframework/platform/config/server/SpringApplicationEnvironmentRepository.java @@ -22,7 +22,7 @@ import java.util.List; import org.springframework.boot.autoconfigure.PropertyPlaceholderAutoConfiguration; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.context.ConfigurableApplicationContext; -import org.springframework.platform.bootstrap.config.Environment; +import org.springframework.platform.config.Environment; import org.springframework.util.StringUtils; /** diff --git a/spring-platform-config-server/src/main/resources/application.yml b/spring-platform-config-server/src/main/resources/application.yml index fa0246f7..69f946b9 100644 --- a/spring-platform-config-server/src/main/resources/application.yml +++ b/spring-platform-config-server/src/main/resources/application.yml @@ -4,4 +4,6 @@ spring: application: name: configserver server: - port: 8888 \ No newline at end of file + port: 8888 +management: + context_path: /admin \ No newline at end of file diff --git a/spring-platform-config-server/src/test/java/org/springframework/platform/config/server/ApplicationTests.java b/spring-platform-config-server/src/test/java/org/springframework/platform/config/server/ApplicationTests.java index 6a9f4402..66f0bd44 100644 --- a/spring-platform-config-server/src/test/java/org/springframework/platform/config/server/ApplicationTests.java +++ b/spring-platform-config-server/src/test/java/org/springframework/platform/config/server/ApplicationTests.java @@ -8,7 +8,7 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.test.IntegrationTest; import org.springframework.boot.test.SpringApplicationConfiguration; import org.springframework.boot.test.TestRestTemplate; -import org.springframework.platform.bootstrap.config.Environment; +import org.springframework.platform.config.Environment; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.web.WebAppConfiguration; diff --git a/spring-platform-config-server/src/test/java/org/springframework/platform/config/server/JGitEnvironmentRepositoryTests.java b/spring-platform-config-server/src/test/java/org/springframework/platform/config/server/JGitEnvironmentRepositoryTests.java index 18ebbb7a..4f0934f3 100644 --- a/spring-platform-config-server/src/test/java/org/springframework/platform/config/server/JGitEnvironmentRepositoryTests.java +++ b/spring-platform-config-server/src/test/java/org/springframework/platform/config/server/JGitEnvironmentRepositoryTests.java @@ -24,7 +24,7 @@ import java.io.File; import org.eclipse.jgit.util.FileUtils; import org.junit.Before; import org.junit.Test; -import org.springframework.platform.bootstrap.config.Environment; +import org.springframework.platform.config.Environment; /** * @author Dave Syer diff --git a/spring-platform-config-server/src/test/java/org/springframework/platform/config/server/SpringApplicationEnvironmentRepositoryTests.java b/spring-platform-config-server/src/test/java/org/springframework/platform/config/server/SpringApplicationEnvironmentRepositoryTests.java index fd1d12ec..d34d961e 100644 --- a/spring-platform-config-server/src/test/java/org/springframework/platform/config/server/SpringApplicationEnvironmentRepositoryTests.java +++ b/spring-platform-config-server/src/test/java/org/springframework/platform/config/server/SpringApplicationEnvironmentRepositoryTests.java @@ -18,7 +18,7 @@ package org.springframework.platform.config.server; import static org.junit.Assert.*; import org.junit.Test; -import org.springframework.platform.bootstrap.config.Environment; +import org.springframework.platform.config.Environment; /**