Restructure 'bootstrap' to use 'zero'
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.sample.service;
|
||||
package org.springframework.zero.sample.actuator;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -14,22 +14,22 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.sample.service;
|
||||
package org.springframework.zero.sample.actuator;
|
||||
|
||||
import org.springframework.bootstrap.SpringApplication;
|
||||
import org.springframework.bootstrap.context.annotation.EnableAutoConfiguration;
|
||||
import org.springframework.bootstrap.context.annotation.EnableConfigurationProperties;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.zero.SpringApplication;
|
||||
import org.springframework.zero.context.annotation.EnableAutoConfiguration;
|
||||
import org.springframework.zero.context.annotation.EnableConfigurationProperties;
|
||||
|
||||
@Configuration
|
||||
@EnableAutoConfiguration
|
||||
@EnableConfigurationProperties
|
||||
@ComponentScan
|
||||
public class ServiceBootstrapApplication {
|
||||
public class SampleActuatorApplication {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
SpringApplication.run(ServiceBootstrapApplication.class, args);
|
||||
SpringApplication.run(SampleActuatorApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.sample.service;
|
||||
package org.springframework.zero.sample.actuator;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
@@ -14,10 +14,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.sample.service;
|
||||
package org.springframework.zero.sample.actuator;
|
||||
|
||||
import org.springframework.bootstrap.context.annotation.ConfigurationProperties;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.zero.context.annotation.ConfigurationProperties;
|
||||
|
||||
@ConfigurationProperties(name = "service", ignoreUnknownFields = false)
|
||||
@Component
|
||||
@@ -3,5 +3,5 @@ handlers = java.util.logging.ConsoleHandler
|
||||
|
||||
#java.util.logging.ConsoleHandler.level = FINE
|
||||
#sun.net.www.protocol.http.HttpURLConnection.level = ALL
|
||||
#org.springframework.bootstrap.level = ALL
|
||||
#org.springframework.zero.level = ALL
|
||||
#org.springframework.security.level = ALL
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.springframework.bootstrap.sample.test;
|
||||
package org.springframework.zero.sample.actuator;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
@@ -11,8 +11,6 @@ import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Test;
|
||||
import org.springframework.bootstrap.SpringApplication;
|
||||
import org.springframework.bootstrap.sample.service.ServiceBootstrapApplication;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
import org.springframework.http.HttpRequest;
|
||||
import org.springframework.http.HttpStatus;
|
||||
@@ -25,6 +23,8 @@ import org.springframework.http.client.SimpleClientHttpRequestFactory;
|
||||
import org.springframework.security.crypto.codec.Base64;
|
||||
import org.springframework.web.client.DefaultResponseErrorHandler;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
import org.springframework.zero.SpringApplication;
|
||||
import org.springframework.zero.sample.actuator.SampleActuatorApplication;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
@@ -33,7 +33,7 @@ import static org.junit.Assert.assertEquals;
|
||||
*
|
||||
* @author Dave Syer
|
||||
*/
|
||||
public class EndpointsPropertiesServiceBootstrapApplicationTests {
|
||||
public class EndpointsPropertiesSampleActuatorApplicationTests {
|
||||
|
||||
private ConfigurableApplicationContext context;
|
||||
|
||||
@@ -60,7 +60,7 @@ public class EndpointsPropertiesServiceBootstrapApplicationTests {
|
||||
|
||||
@Test
|
||||
public void testCustomErrorPath() throws Exception {
|
||||
start(ServiceBootstrapApplication.class, "--error.path=/oops");
|
||||
start(SampleActuatorApplication.class, "--error.path=/oops");
|
||||
testError();
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.springframework.bootstrap.sample.test;
|
||||
package org.springframework.zero.sample.actuator;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
@@ -13,8 +13,6 @@ import org.junit.AfterClass;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.springframework.bootstrap.SpringApplication;
|
||||
import org.springframework.bootstrap.sample.service.ServiceBootstrapApplication;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
import org.springframework.http.HttpRequest;
|
||||
import org.springframework.http.HttpStatus;
|
||||
@@ -27,6 +25,8 @@ import org.springframework.http.client.SimpleClientHttpRequestFactory;
|
||||
import org.springframework.security.crypto.codec.Base64;
|
||||
import org.springframework.web.client.DefaultResponseErrorHandler;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
import org.springframework.zero.SpringApplication;
|
||||
import org.springframework.zero.sample.actuator.SampleActuatorApplication;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
@@ -35,7 +35,7 @@ import static org.junit.Assert.assertEquals;
|
||||
*
|
||||
* @author Dave Syer
|
||||
*/
|
||||
public class ManagementAddressServiceBootstrapApplicationTests {
|
||||
public class ManagementAddressSampleActuatorApplicationTests {
|
||||
|
||||
private static ConfigurableApplicationContext context;
|
||||
|
||||
@@ -52,7 +52,7 @@ public class ManagementAddressServiceBootstrapApplicationTests {
|
||||
@Override
|
||||
public ConfigurableApplicationContext call() throws Exception {
|
||||
return (ConfigurableApplicationContext) SpringApplication
|
||||
.run(ServiceBootstrapApplication.class, args);
|
||||
.run(SampleActuatorApplication.class, args);
|
||||
}
|
||||
});
|
||||
context = future.get(30, TimeUnit.SECONDS);
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.springframework.bootstrap.sample.test;
|
||||
package org.springframework.zero.sample.actuator;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
@@ -10,14 +10,14 @@ import java.util.concurrent.TimeUnit;
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import org.springframework.bootstrap.SpringApplication;
|
||||
import org.springframework.bootstrap.sample.service.ServiceBootstrapApplication;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.http.client.ClientHttpResponse;
|
||||
import org.springframework.web.client.DefaultResponseErrorHandler;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
import org.springframework.zero.SpringApplication;
|
||||
import org.springframework.zero.sample.actuator.SampleActuatorApplication;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
@@ -27,7 +27,7 @@ import static org.junit.Assert.assertEquals;
|
||||
* @author Dave Syer
|
||||
*
|
||||
*/
|
||||
public class ManagementServiceBootstrapApplicationTests {
|
||||
public class ManagementSampleActuatorApplicationTests {
|
||||
|
||||
private static ConfigurableApplicationContext context;
|
||||
|
||||
@@ -44,7 +44,7 @@ public class ManagementServiceBootstrapApplicationTests {
|
||||
@Override
|
||||
public ConfigurableApplicationContext call() throws Exception {
|
||||
return (ConfigurableApplicationContext) SpringApplication
|
||||
.run(ServiceBootstrapApplication.class, args);
|
||||
.run(SampleActuatorApplication.class, args);
|
||||
}
|
||||
});
|
||||
context = future.get(30, TimeUnit.SECONDS);
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.springframework.bootstrap.sample.test;
|
||||
package org.springframework.zero.sample.actuator;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
@@ -12,8 +12,6 @@ import java.util.concurrent.TimeUnit;
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import org.springframework.bootstrap.SpringApplication;
|
||||
import org.springframework.bootstrap.sample.service.ServiceBootstrapApplication;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
import org.springframework.http.HttpRequest;
|
||||
import org.springframework.http.HttpStatus;
|
||||
@@ -27,6 +25,8 @@ import org.springframework.security.crypto.codec.Base64;
|
||||
import org.springframework.web.client.DefaultResponseErrorHandler;
|
||||
import org.springframework.web.client.ResourceAccessException;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
import org.springframework.zero.SpringApplication;
|
||||
import org.springframework.zero.sample.actuator.SampleActuatorApplication;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
@@ -36,7 +36,7 @@ import static org.junit.Assert.assertEquals;
|
||||
* @author Dave Syer
|
||||
*
|
||||
*/
|
||||
public class NoManagementServiceBootstrapApplicationTests {
|
||||
public class NoManagementSampleActuatorApplicationTests {
|
||||
|
||||
private static ConfigurableApplicationContext context;
|
||||
|
||||
@@ -51,7 +51,7 @@ public class NoManagementServiceBootstrapApplicationTests {
|
||||
@Override
|
||||
public ConfigurableApplicationContext call() throws Exception {
|
||||
return (ConfigurableApplicationContext) SpringApplication
|
||||
.run(ServiceBootstrapApplication.class, args);
|
||||
.run(SampleActuatorApplication.class, args);
|
||||
}
|
||||
});
|
||||
context = future.get(10, TimeUnit.SECONDS);
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.springframework.bootstrap.sample.test;
|
||||
package org.springframework.zero.sample.actuator;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
@@ -12,8 +12,6 @@ import java.util.concurrent.TimeUnit;
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import org.springframework.bootstrap.SpringApplication;
|
||||
import org.springframework.bootstrap.sample.service.ServiceBootstrapApplication;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
import org.springframework.http.HttpRequest;
|
||||
import org.springframework.http.HttpStatus;
|
||||
@@ -26,6 +24,8 @@ import org.springframework.http.client.SimpleClientHttpRequestFactory;
|
||||
import org.springframework.security.crypto.codec.Base64;
|
||||
import org.springframework.web.client.DefaultResponseErrorHandler;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
import org.springframework.zero.SpringApplication;
|
||||
import org.springframework.zero.sample.actuator.SampleActuatorApplication;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
@@ -37,7 +37,7 @@ import static org.junit.Assert.assertTrue;
|
||||
* @author Dave Syer
|
||||
*
|
||||
*/
|
||||
public class ServiceBootstrapApplicationTests {
|
||||
public class SampleActuatorApplicationTests {
|
||||
|
||||
private static ConfigurableApplicationContext context;
|
||||
|
||||
@@ -49,7 +49,7 @@ public class ServiceBootstrapApplicationTests {
|
||||
@Override
|
||||
public ConfigurableApplicationContext call() throws Exception {
|
||||
return (ConfigurableApplicationContext) SpringApplication
|
||||
.run(ServiceBootstrapApplication.class);
|
||||
.run(SampleActuatorApplication.class);
|
||||
}
|
||||
});
|
||||
context = future.get(30, TimeUnit.SECONDS);
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.springframework.bootstrap.sample.test;
|
||||
package org.springframework.zero.sample.actuator;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
@@ -12,8 +12,6 @@ import java.util.concurrent.TimeUnit;
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import org.springframework.bootstrap.SpringApplication;
|
||||
import org.springframework.bootstrap.sample.service.ServiceBootstrapApplication;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
import org.springframework.http.HttpRequest;
|
||||
import org.springframework.http.HttpStatus;
|
||||
@@ -26,6 +24,8 @@ import org.springframework.http.client.SimpleClientHttpRequestFactory;
|
||||
import org.springframework.security.crypto.codec.Base64;
|
||||
import org.springframework.web.client.DefaultResponseErrorHandler;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
import org.springframework.zero.SpringApplication;
|
||||
import org.springframework.zero.sample.actuator.SampleActuatorApplication;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
@@ -36,7 +36,7 @@ import static org.junit.Assert.assertTrue;
|
||||
* @author Dave Syer
|
||||
*
|
||||
*/
|
||||
public class ShutdownServiceBootstrapApplicationTests {
|
||||
public class ShutdownSampleActuatorApplicationTests {
|
||||
|
||||
private static ConfigurableApplicationContext context;
|
||||
|
||||
@@ -48,7 +48,7 @@ public class ShutdownServiceBootstrapApplicationTests {
|
||||
@Override
|
||||
public ConfigurableApplicationContext call() throws Exception {
|
||||
return (ConfigurableApplicationContext) SpringApplication
|
||||
.run(ServiceBootstrapApplication.class);
|
||||
.run(SampleActuatorApplication.class);
|
||||
}
|
||||
});
|
||||
context = future.get(10, TimeUnit.SECONDS);
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.springframework.bootstrap.sample.test;
|
||||
package org.springframework.zero.sample.actuator;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
@@ -10,14 +10,13 @@ import java.util.concurrent.TimeUnit;
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import org.springframework.bootstrap.SpringApplication;
|
||||
import org.springframework.bootstrap.sample.service.ServiceBootstrapApplication;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.http.client.ClientHttpResponse;
|
||||
import org.springframework.web.client.DefaultResponseErrorHandler;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
import org.springframework.zero.SpringApplication;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
@@ -27,9 +26,8 @@ import static org.junit.Assert.assertFalse;
|
||||
* classpath).
|
||||
*
|
||||
* @author Dave Syer
|
||||
*
|
||||
*/
|
||||
public class UnsecureServiceBootstrapApplicationTests {
|
||||
public class UnsecureSampleActuatorApplicationTests {
|
||||
|
||||
private static ConfigurableApplicationContext context;
|
||||
|
||||
@@ -41,7 +39,7 @@ public class UnsecureServiceBootstrapApplicationTests {
|
||||
@Override
|
||||
public ConfigurableApplicationContext call() throws Exception {
|
||||
return (ConfigurableApplicationContext) SpringApplication
|
||||
.run(ServiceBootstrapApplication.class,
|
||||
.run(SampleActuatorApplication.class,
|
||||
"--security.basic.enabled=false");
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user