private void configure(String remoteUrl, boolean setSecret, String... pairs) { this.context = new AnnotationConfigEmbeddedWebApplicationContext(); new RestartScopeInitializer().initialize(this.context); this.context.register(Config.class, RemoteClientConfiguration.class); String remoteUrlProperty = "remoteUrl:" + remoteUrl + ":" + RemoteClientConfigurationTests.remotePort; EnvironmentTestUtils.addEnvironment(this.context, remoteUrlProperty); EnvironmentTestUtils.addEnvironment(this.context, pairs); if (setSecret) { EnvironmentTestUtils.addEnvironment(this.context, "spring.devtools.remote.secret:secret"); } this.context.refresh(); }
private Collection<ApplicationContextInitializer<?>> getInitializers() { List<ApplicationContextInitializer<?>> initializers = new ArrayList<ApplicationContextInitializer<?>>(); initializers.add(new RestartScopeInitializer()); return initializers; }