Browse Source

Apply latest eclipse cleanup rules

pull/252/head
Phillip Webb 12 years ago
parent
commit
0160760568
  1. 1
      spring-boot-actuator/src/test/java/org/springframework/boot/actuate/audit/AuditEventTests.java
  2. 2
      spring-boot-actuator/src/test/java/org/springframework/boot/actuate/audit/InMemoryAuditEventRepositoryTests.java
  3. 2
      spring-boot-actuator/src/test/java/org/springframework/boot/actuate/audit/listener/AuditListenerTests.java
  4. 1
      spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/AuditAutoConfigurationTests.java
  5. 1
      spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/ManagementServerPropertiesAutoConfigurationTests.java
  6. 1
      spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/MetricFilterAutoConfigurationTests.java
  7. 1
      spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/TraceRepositoryAutoConfigurationTests.java
  8. 2
      spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/TraceWebFilterAutoConfigurationTest.java
  9. 2
      spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/mvc/EnvironmentMvcEndpointTests.java
  10. 2
      spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/mvc/JolokiaEndpointTests.java
  11. 1
      spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/VanillaHealthIndicatorTests.java
  12. 1
      spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/repository/InMemoryMetricRepositoryTests.java
  13. 3
      spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/writer/DefaultCounterServiceTests.java
  14. 2
      spring-boot-actuator/src/test/java/org/springframework/boot/actuate/trace/InMemoryTraceRepositoryTests.java
  15. 2
      spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/MessageSourceAutoConfigurationTests.java
  16. 2
      spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/batch/BatchAutoConfigurationTests.java
  17. 2
      spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/batch/JobExecutionExitCodeGeneratorTests.java
  18. 2
      spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/JpaRepositoriesAutoConfigurationTests.java
  19. 2
      spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/JpaWebAutoConfigurationTests.java
  20. 2
      spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/MongoRepositoriesAutoConfigurationTests.java
  21. 1
      spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jdbc/CommonsDataSourceConfigurationTests.java
  22. 1
      spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jdbc/EmbeddedDataSourceConfigurationTests.java
  23. 2
      spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/reactor/ReactorAutoConfigurationTests.java
  24. 2
      spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/SecurityAutoConfigurationTests.java
  25. 1
      spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/SecurityPropertiesTests.java
  26. 1
      spring-boot-cli/src/it/java/org/springframework/boot/cli/infrastructure/CommandLineInvoker.java
  27. 4
      spring-boot-samples/spring-boot-sample-actuator-noweb/src/test/java/sample/actuator/SampleActuatorNoWebApplicationTests.java
  28. 5
      spring-boot-samples/spring-boot-sample-actuator-ui/src/test/java/sample/actuator/ui/SampleActuatorUiApplicationPortTests.java
  29. 1
      spring-boot-samples/spring-boot-sample-actuator-ui/src/test/java/sample/actuator/ui/SampleActuatorUiApplicationTests.java
  30. 1
      spring-boot-samples/spring-boot-sample-actuator/src/test/java/sample/actuator/EndpointsPropertiesSampleActuatorApplicationTests.java
  31. 5
      spring-boot-samples/spring-boot-sample-actuator/src/test/java/sample/actuator/ManagementAddressSampleActuatorApplicationTests.java
  32. 1
      spring-boot-samples/spring-boot-sample-actuator/src/test/java/sample/actuator/ManagementSampleActuatorApplicationTests.java
  33. 1
      spring-boot-samples/spring-boot-sample-actuator/src/test/java/sample/actuator/NoManagementSampleActuatorApplicationTests.java
  34. 11
      spring-boot-samples/spring-boot-sample-actuator/src/test/java/sample/actuator/SampleActuatorApplicationTests.java
  35. 1
      spring-boot-samples/spring-boot-sample-actuator/src/test/java/sample/actuator/ShutdownSampleActuatorApplicationTests.java
  36. 9
      spring-boot-samples/spring-boot-sample-actuator/src/test/java/sample/actuator/UnsecureManagementSampleActuatorApplicationTests.java
  37. 1
      spring-boot-samples/spring-boot-sample-actuator/src/test/java/sample/actuator/UnsecureSampleActuatorApplicationTests.java
  38. 3
      spring-boot-samples/spring-boot-sample-aop/src/main/java/sample/aop/SampleAopApplication.java
  39. 1
      spring-boot-samples/spring-boot-sample-aop/src/test/java/sample/aop/SampleAopApplicationTests.java
  40. 3
      spring-boot-samples/spring-boot-sample-data-jpa/src/main/java/sample/data/jpa/service/CityRepository.java
  41. 5
      spring-boot-samples/spring-boot-sample-data-jpa/src/main/java/sample/data/jpa/service/CityService.java
  42. 5
      spring-boot-samples/spring-boot-sample-data-jpa/src/main/java/sample/data/jpa/service/CityServiceImpl.java
  43. 5
      spring-boot-samples/spring-boot-sample-data-jpa/src/main/java/sample/data/jpa/service/HotelService.java
  44. 11
      spring-boot-samples/spring-boot-sample-data-jpa/src/main/java/sample/data/jpa/service/HotelServiceImpl.java
  45. 5
      spring-boot-samples/spring-boot-sample-data-jpa/src/main/java/sample/data/jpa/service/ReviewRepository.java
  46. 3
      spring-boot-samples/spring-boot-sample-data-jpa/src/main/java/sample/data/jpa/web/SampleController.java
  47. 8
      spring-boot-samples/spring-boot-sample-data-jpa/src/test/java/sample/data/jpa/SampleDataJpaApplicationTests.java
  48. 13
      spring-boot-samples/spring-boot-sample-data-jpa/src/test/java/sample/data/jpa/service/CityRepositoryIntegrationTests.java
  49. 21
      spring-boot-samples/spring-boot-sample-data-jpa/src/test/java/sample/data/jpa/service/HotelRepositoryIntegrationTests.java
  50. 4
      spring-boot-samples/spring-boot-sample-data-mongodb/src/test/java/sample/data/mongo/SampleMongoApplicationTests.java
  51. 5
      spring-boot-samples/spring-boot-sample-integration/src/test/java/sample/integration/consumer/SampleIntegrationApplicationTests.java
  52. 3
      spring-boot-samples/spring-boot-sample-jetty/src/main/java/sample/jetty/web/SampleController.java
  53. 3
      spring-boot-samples/spring-boot-sample-profile/src/main/java/sample/profile/SampleProfileApplication.java
  54. 4
      spring-boot-samples/spring-boot-sample-secure/src/test/java/sample/secure/SampleSecureApplicationTests.java
  55. 4
      spring-boot-samples/spring-boot-sample-servlet/src/test/java/sample/servlet/SampleServletApplicationTests.java
  56. 3
      spring-boot-samples/spring-boot-sample-simple/src/main/java/sample/simple/SampleSimpleApplication.java
  57. 3
      spring-boot-samples/spring-boot-sample-tomcat/src/main/java/sample/tomcat/web/SampleController.java
  58. 5
      spring-boot-samples/spring-boot-sample-tomcat/src/test/java/sample/tomcat/NonAutoConfigurationSampleTomcatApplicationTests.java
  59. 3
      spring-boot-samples/spring-boot-sample-web-jsp/src/test/java/sample/jsp/SampleWebJspApplicationTests.java
  60. 6
      spring-boot-samples/spring-boot-sample-web-secure/src/test/java/sample/ops/ui/SampleSecureApplicationTests.java
  61. 3
      spring-boot-samples/spring-boot-sample-web-static/src/test/java/sample/ui/SampleWebStaticApplicationTests.java
  62. 5
      spring-boot-samples/spring-boot-sample-web-ui/src/main/java/sample/ui/mvc/MessageController.java
  63. 14
      spring-boot-samples/spring-boot-sample-web-ui/src/test/java/sample/ui/MessageControllerWebTests.java
  64. 11
      spring-boot-samples/spring-boot-sample-websocket/src/main/java/samples/websocket/config/SampleWebSocketsApplication.java
  65. 12
      spring-boot-samples/spring-boot-sample-websocket/src/main/java/samples/websocket/snake/Location.java
  66. 9
      spring-boot-samples/spring-boot-sample-websocket/src/test/java/samples/websocket/echo/SampleWebSocketsApplicationTests.java
  67. 1
      spring-boot-samples/spring-boot-sample-xml/src/main/java/sample/xml/SampleSpringXmlApplication.java
  68. 4
      spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/task/ProjectLibraries.java
  69. 13
      spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/task/Repackage.java
  70. 8
      spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/task/RunApp.java
  71. 3
      spring-boot-tools/spring-boot-loader-tools/src/test/java/org/springframework/boot/loader/tools/LayoutsTests.java
  72. 1
      spring-boot-tools/spring-boot-maven-plugin/src/test/java/org/springframework/boot/maven/PropertiesMergingResourceTransformerTests.java
  73. 3
      spring-boot/src/main/java/org/springframework/boot/bind/RelaxedNames.java
  74. 6
      spring-boot/src/test/java/org/springframework/boot/ansi/AnsiOutputTest.java
  75. 1
      spring-boot/src/test/java/org/springframework/boot/config/ArrayDocumentMatcherTests.java
  76. 1
      spring-boot/src/test/java/org/springframework/boot/context/embedded/MimeMappingsTests.java
  77. 2
      spring-boot/src/test/java/org/springframework/boot/context/embedded/jetty/JettyEmbeddedServletContainerFactoryTests.java
  78. 2
      spring-boot/src/test/java/org/springframework/boot/logging/logback/ColorConverterTests.java

1
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/audit/AuditEventTests.java

@ -19,7 +19,6 @@ package org.springframework.boot.actuate.audit; @@ -19,7 +19,6 @@ package org.springframework.boot.actuate.audit;
import java.util.Collections;
import org.junit.Test;
import org.springframework.boot.actuate.audit.AuditEvent;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;

2
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/audit/InMemoryAuditEventRepositoryTests.java

@ -19,8 +19,6 @@ package org.springframework.boot.actuate.audit; @@ -19,8 +19,6 @@ package org.springframework.boot.actuate.audit;
import java.util.Date;
import org.junit.Test;
import org.springframework.boot.actuate.audit.AuditEvent;
import org.springframework.boot.actuate.audit.InMemoryAuditEventRepository;
import static org.junit.Assert.assertEquals;

2
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/audit/listener/AuditListenerTests.java

@ -21,8 +21,6 @@ import java.util.Collections; @@ -21,8 +21,6 @@ import java.util.Collections;
import org.junit.Test;
import org.springframework.boot.actuate.audit.AuditEvent;
import org.springframework.boot.actuate.audit.AuditEventRepository;
import org.springframework.boot.actuate.audit.listener.AuditApplicationEvent;
import org.springframework.boot.actuate.audit.listener.AuditListener;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;

1
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/AuditAutoConfigurationTests.java

@ -19,7 +19,6 @@ package org.springframework.boot.actuate.autoconfigure; @@ -19,7 +19,6 @@ package org.springframework.boot.actuate.autoconfigure;
import org.junit.Test;
import org.springframework.boot.actuate.audit.AuditEventRepository;
import org.springframework.boot.actuate.audit.InMemoryAuditEventRepository;
import org.springframework.boot.actuate.autoconfigure.AuditAutoConfiguration;
import org.springframework.boot.actuate.security.AuthenticationAuditListener;
import org.springframework.boot.actuate.security.AuthorizationAuditListener;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

1
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/ManagementServerPropertiesAutoConfigurationTests.java

@ -17,7 +17,6 @@ @@ -17,7 +17,6 @@
package org.springframework.boot.actuate.autoconfigure;
import org.junit.Test;
import org.springframework.boot.actuate.autoconfigure.ManagementServerPropertiesAutoConfiguration;
import org.springframework.boot.actuate.properties.ManagementServerProperties;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Bean;

1
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/MetricFilterAutoConfigurationTests.java

@ -22,7 +22,6 @@ import javax.servlet.FilterChain; @@ -22,7 +22,6 @@ import javax.servlet.FilterChain;
import org.junit.Test;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
import org.springframework.boot.actuate.autoconfigure.MetricFilterAutoConfiguration;
import org.springframework.boot.actuate.metrics.CounterService;
import org.springframework.boot.actuate.metrics.GaugeService;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

1
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/TraceRepositoryAutoConfigurationTests.java

@ -17,7 +17,6 @@ @@ -17,7 +17,6 @@
package org.springframework.boot.actuate.autoconfigure;
import org.junit.Test;
import org.springframework.boot.actuate.autoconfigure.TraceRepositoryAutoConfiguration;
import org.springframework.boot.actuate.trace.InMemoryTraceRepository;
import org.springframework.boot.actuate.trace.TraceRepository;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

2
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/TraceWebFilterAutoConfigurationTest.java

@ -17,8 +17,6 @@ @@ -17,8 +17,6 @@
package org.springframework.boot.actuate.autoconfigure;
import org.junit.Test;
import org.springframework.boot.actuate.autoconfigure.TraceRepositoryAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.TraceWebFilterAutoConfiguration;
import org.springframework.boot.actuate.trace.WebRequestTraceFilter;
import org.springframework.boot.autoconfigure.PropertyPlaceholderAutoConfiguration;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

2
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/mvc/EnvironmentMvcEndpointTests.java

@ -24,8 +24,8 @@ import org.springframework.boot.actuate.autoconfigure.EndpointWebMvcAutoConfigur @@ -24,8 +24,8 @@ import org.springframework.boot.actuate.autoconfigure.EndpointWebMvcAutoConfigur
import org.springframework.boot.actuate.autoconfigure.ManagementServerPropertiesAutoConfiguration;
import org.springframework.boot.actuate.endpoint.EnvironmentEndpoint;
import org.springframework.boot.actuate.endpoint.mvc.EnvironmentMvcEndpointTests.TestConfiguration;
import org.springframework.boot.test.SpringApplicationConfiguration;
import org.springframework.boot.test.EnvironmentTestUtils;
import org.springframework.boot.test.SpringApplicationConfiguration;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

2
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/mvc/JolokiaEndpointTests.java

@ -27,8 +27,8 @@ import org.springframework.boot.actuate.autoconfigure.JolokiaAutoConfiguration; @@ -27,8 +27,8 @@ import org.springframework.boot.actuate.autoconfigure.JolokiaAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.ManagementServerPropertiesAutoConfiguration;
import org.springframework.boot.actuate.endpoint.mvc.JolokiaEndpointTests.Config;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.test.SpringApplicationConfiguration;
import org.springframework.boot.test.EnvironmentTestUtils;
import org.springframework.boot.test.SpringApplicationConfiguration;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

1
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/VanillaHealthIndicatorTests.java

@ -17,7 +17,6 @@ @@ -17,7 +17,6 @@
package org.springframework.boot.actuate.health;
import org.junit.Test;
import org.springframework.boot.actuate.health.VanillaHealthIndicator;
import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertThat;

1
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/repository/InMemoryMetricRepositoryTests.java

@ -20,7 +20,6 @@ import java.util.Date; @@ -20,7 +20,6 @@ import java.util.Date;
import org.junit.Test;
import org.springframework.boot.actuate.metrics.Metric;
import org.springframework.boot.actuate.metrics.repository.InMemoryMetricRepository;
import org.springframework.boot.actuate.metrics.writer.Delta;
import static org.junit.Assert.assertEquals;

3
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/writer/DefaultCounterServiceTests.java

@ -18,9 +18,6 @@ package org.springframework.boot.actuate.metrics.writer; @@ -18,9 +18,6 @@ package org.springframework.boot.actuate.metrics.writer;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
import org.springframework.boot.actuate.metrics.writer.DefaultCounterService;
import org.springframework.boot.actuate.metrics.writer.Delta;
import org.springframework.boot.actuate.metrics.writer.MetricWriter;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.mock;

2
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/trace/InMemoryTraceRepositoryTests.java

@ -20,8 +20,6 @@ import java.util.Collections; @@ -20,8 +20,6 @@ import java.util.Collections;
import java.util.List;
import org.junit.Test;
import org.springframework.boot.actuate.trace.InMemoryTraceRepository;
import org.springframework.boot.actuate.trace.Trace;
import static org.junit.Assert.assertEquals;

2
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/MessageSourceAutoConfigurationTests.java

@ -21,8 +21,6 @@ import java.util.Locale; @@ -21,8 +21,6 @@ import java.util.Locale;
import java.util.Map;
import org.junit.Test;
import org.springframework.boot.autoconfigure.MessageSourceAutoConfiguration;
import org.springframework.boot.autoconfigure.PropertyPlaceholderAutoConfiguration;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.core.env.MapPropertySource;

2
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/batch/BatchAutoConfigurationTests.java

@ -39,8 +39,8 @@ import org.springframework.batch.core.launch.JobLauncher; @@ -39,8 +39,8 @@ import org.springframework.batch.core.launch.JobLauncher;
import org.springframework.batch.core.repository.JobRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.autoconfigure.TestAutoConfigurationPackage;
import org.springframework.boot.autoconfigure.PropertyPlaceholderAutoConfiguration;
import org.springframework.boot.autoconfigure.TestAutoConfigurationPackage;
import org.springframework.boot.autoconfigure.jdbc.EmbeddedDataSourceConfiguration;
import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
import org.springframework.boot.autoconfigure.orm.jpa.test.City;

2
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/batch/JobExecutionExitCodeGeneratorTests.java

@ -19,8 +19,6 @@ package org.springframework.boot.autoconfigure.batch; @@ -19,8 +19,6 @@ package org.springframework.boot.autoconfigure.batch;
import org.junit.Test;
import org.springframework.batch.core.BatchStatus;
import org.springframework.batch.core.JobExecution;
import org.springframework.boot.autoconfigure.batch.JobExecutionEvent;
import org.springframework.boot.autoconfigure.batch.JobExecutionExitCodeGenerator;
import static org.junit.Assert.assertEquals;

2
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/JpaRepositoriesAutoConfigurationTests.java

@ -19,8 +19,8 @@ package org.springframework.boot.autoconfigure.data; @@ -19,8 +19,8 @@ package org.springframework.boot.autoconfigure.data;
import javax.persistence.EntityManagerFactory;
import org.junit.Test;
import org.springframework.boot.autoconfigure.TestAutoConfigurationPackage;
import org.springframework.boot.autoconfigure.PropertyPlaceholderAutoConfiguration;
import org.springframework.boot.autoconfigure.TestAutoConfigurationPackage;
import org.springframework.boot.autoconfigure.data.jpa.City;
import org.springframework.boot.autoconfigure.data.jpa.CityRepository;
import org.springframework.boot.autoconfigure.jdbc.EmbeddedDataSourceConfiguration;

2
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/JpaWebAutoConfigurationTests.java

@ -17,8 +17,8 @@ @@ -17,8 +17,8 @@
package org.springframework.boot.autoconfigure.data;
import org.junit.Test;
import org.springframework.boot.autoconfigure.TestAutoConfigurationPackage;
import org.springframework.boot.autoconfigure.PropertyPlaceholderAutoConfiguration;
import org.springframework.boot.autoconfigure.TestAutoConfigurationPackage;
import org.springframework.boot.autoconfigure.data.jpa.City;
import org.springframework.boot.autoconfigure.data.jpa.CityRepository;
import org.springframework.boot.autoconfigure.jdbc.EmbeddedDataSourceConfiguration;

2
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/MongoRepositoriesAutoConfigurationTests.java

@ -17,8 +17,8 @@ @@ -17,8 +17,8 @@
package org.springframework.boot.autoconfigure.data;
import org.junit.Test;
import org.springframework.boot.autoconfigure.TestAutoConfigurationPackage;
import org.springframework.boot.autoconfigure.PropertyPlaceholderAutoConfiguration;
import org.springframework.boot.autoconfigure.TestAutoConfigurationPackage;
import org.springframework.boot.autoconfigure.data.mongo.City;
import org.springframework.boot.autoconfigure.data.mongo.CityRepository;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

1
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jdbc/CommonsDataSourceConfigurationTests.java

@ -19,7 +19,6 @@ package org.springframework.boot.autoconfigure.jdbc; @@ -19,7 +19,6 @@ package org.springframework.boot.autoconfigure.jdbc;
import javax.sql.DataSource;
import org.junit.Test;
import org.springframework.boot.autoconfigure.jdbc.CommonsDataSourceConfiguration;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import static org.junit.Assert.assertNotNull;

1
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jdbc/EmbeddedDataSourceConfigurationTests.java

@ -19,7 +19,6 @@ package org.springframework.boot.autoconfigure.jdbc; @@ -19,7 +19,6 @@ package org.springframework.boot.autoconfigure.jdbc;
import javax.sql.DataSource;
import org.junit.Test;
import org.springframework.boot.autoconfigure.jdbc.EmbeddedDataSourceConfiguration;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import static org.junit.Assert.assertNotNull;

2
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/reactor/ReactorAutoConfigurationTests.java

@ -17,10 +17,10 @@ @@ -17,10 +17,10 @@
package org.springframework.boot.autoconfigure.reactor;
import org.junit.Test;
import org.springframework.boot.autoconfigure.reactor.ReactorAutoConfiguration;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import reactor.core.Reactor;
import static org.junit.Assert.assertNotNull;
/**

2
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/SecurityAutoConfigurationTests.java

@ -19,9 +19,9 @@ package org.springframework.boot.autoconfigure.security; @@ -19,9 +19,9 @@ package org.springframework.boot.autoconfigure.security;
import org.junit.Test;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.SpringApplicationBeforeRefreshEvent;
import org.springframework.boot.autoconfigure.TestAutoConfigurationPackage;
import org.springframework.boot.autoconfigure.AutoConfigurationReportLoggingInitializer;
import org.springframework.boot.autoconfigure.PropertyPlaceholderAutoConfiguration;
import org.springframework.boot.autoconfigure.TestAutoConfigurationPackage;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
import org.springframework.boot.autoconfigure.orm.jpa.test.City;

1
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/SecurityPropertiesTests.java

@ -22,7 +22,6 @@ import java.util.Map; @@ -22,7 +22,6 @@ import java.util.Map;
import org.junit.Test;
import org.springframework.beans.MutablePropertyValues;
import org.springframework.boot.autoconfigure.security.SecurityProperties;
import org.springframework.boot.bind.RelaxedDataBinder;
import org.springframework.core.convert.support.DefaultConversionService;

1
spring-boot-cli/src/it/java/org/springframework/boot/cli/infrastructure/CommandLineInvoker.java

@ -132,6 +132,7 @@ public final class CommandLineInvoker { @@ -132,6 +132,7 @@ public final class CommandLineInvoker {
this.output = buffer;
}
@Override
public void run() {
int read;
try {

4
spring-boot-samples/spring-boot-sample-actuator-noweb/src/test/java/sample/actuator/SampleActuatorNoWebApplicationTests.java

@ -16,8 +16,6 @@ @@ -16,8 +16,6 @@
package sample.actuator;
import static org.junit.Assert.assertNotNull;
import java.util.concurrent.Callable;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
@ -30,6 +28,8 @@ import org.springframework.boot.SpringApplication; @@ -30,6 +28,8 @@ import org.springframework.boot.SpringApplication;
import org.springframework.boot.actuate.endpoint.MetricsEndpoint;
import org.springframework.context.ConfigurableApplicationContext;
import static org.junit.Assert.assertNotNull;
/**
* Basic integration tests for service demo application.
*

5
spring-boot-samples/spring-boot-sample-actuator-ui/src/test/java/sample/actuator/ui/SampleActuatorUiApplicationPortTests.java

@ -16,8 +16,6 @@ @@ -16,8 +16,6 @@
package sample.actuator.ui;
import static org.junit.Assert.assertEquals;
import java.io.IOException;
import java.util.Map;
import java.util.concurrent.Callable;
@ -29,7 +27,6 @@ import org.junit.AfterClass; @@ -29,7 +27,6 @@ import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.springframework.boot.SpringApplication;
import sample.actuator.ui.SampleActuatorUiApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
@ -37,6 +34,8 @@ import org.springframework.http.client.ClientHttpResponse; @@ -37,6 +34,8 @@ import org.springframework.http.client.ClientHttpResponse;
import org.springframework.web.client.DefaultResponseErrorHandler;
import org.springframework.web.client.RestTemplate;
import static org.junit.Assert.assertEquals;
/**
* Integration tests for separate management and main service ports.
*

1
spring-boot-samples/spring-boot-sample-actuator-ui/src/test/java/sample/actuator/ui/SampleActuatorUiApplicationTests.java

@ -28,7 +28,6 @@ import org.junit.AfterClass; @@ -28,7 +28,6 @@ import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.springframework.boot.SpringApplication;
import sample.actuator.ui.SampleActuatorUiApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;

1
spring-boot-samples/spring-boot-sample-actuator/src/test/java/sample/actuator/EndpointsPropertiesSampleActuatorApplicationTests.java

@ -28,7 +28,6 @@ import java.util.concurrent.TimeUnit; @@ -28,7 +28,6 @@ import java.util.concurrent.TimeUnit;
import org.junit.After;
import org.junit.Test;
import org.springframework.boot.SpringApplication;
import sample.actuator.SampleActuatorApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.http.HttpRequest;
import org.springframework.http.HttpStatus;

5
spring-boot-samples/spring-boot-sample-actuator/src/test/java/sample/actuator/ManagementAddressSampleActuatorApplicationTests.java

@ -16,8 +16,6 @@ @@ -16,8 +16,6 @@
package sample.actuator;
import static org.junit.Assert.assertEquals;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
@ -32,7 +30,6 @@ import org.junit.BeforeClass; @@ -32,7 +30,6 @@ import org.junit.BeforeClass;
import org.junit.Test;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.security.SecurityProperties;
import sample.actuator.SampleActuatorApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.http.HttpRequest;
import org.springframework.http.HttpStatus;
@ -46,6 +43,8 @@ import org.springframework.security.crypto.codec.Base64; @@ -46,6 +43,8 @@ import org.springframework.security.crypto.codec.Base64;
import org.springframework.web.client.DefaultResponseErrorHandler;
import org.springframework.web.client.RestTemplate;
import static org.junit.Assert.assertEquals;
/**
* Integration tests for separate management and main service ports.
*

1
spring-boot-samples/spring-boot-sample-actuator/src/test/java/sample/actuator/ManagementSampleActuatorApplicationTests.java

@ -27,7 +27,6 @@ import org.junit.AfterClass; @@ -27,7 +27,6 @@ import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.springframework.boot.SpringApplication;
import sample.actuator.SampleActuatorApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;

1
spring-boot-samples/spring-boot-sample-actuator/src/test/java/sample/actuator/NoManagementSampleActuatorApplicationTests.java

@ -30,7 +30,6 @@ import org.junit.BeforeClass; @@ -30,7 +30,6 @@ import org.junit.BeforeClass;
import org.junit.Test;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.security.SecurityProperties;
import sample.actuator.SampleActuatorApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.http.HttpRequest;
import org.springframework.http.HttpStatus;

11
spring-boot-samples/spring-boot-sample-actuator/src/test/java/sample/actuator/SampleActuatorApplicationTests.java

@ -16,11 +16,6 @@ @@ -16,11 +16,6 @@
package sample.actuator;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
@ -36,7 +31,6 @@ import org.junit.BeforeClass; @@ -36,7 +31,6 @@ import org.junit.BeforeClass;
import org.junit.Test;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.security.SecurityProperties;
import sample.actuator.SampleActuatorApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
@ -54,6 +48,11 @@ import org.springframework.security.crypto.codec.Base64; @@ -54,6 +48,11 @@ import org.springframework.security.crypto.codec.Base64;
import org.springframework.web.client.DefaultResponseErrorHandler;
import org.springframework.web.client.RestTemplate;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
/**
* Basic integration tests for service demo application.
*

1
spring-boot-samples/spring-boot-sample-actuator/src/test/java/sample/actuator/ShutdownSampleActuatorApplicationTests.java

@ -30,7 +30,6 @@ import org.junit.BeforeClass; @@ -30,7 +30,6 @@ import org.junit.BeforeClass;
import org.junit.Test;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.security.SecurityProperties;
import sample.actuator.SampleActuatorApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.http.HttpRequest;
import org.springframework.http.HttpStatus;

9
spring-boot-samples/spring-boot-sample-actuator/src/test/java/sample/actuator/UnsecureManagementSampleActuatorApplicationTests.java

@ -16,10 +16,6 @@ @@ -16,10 +16,6 @@
package sample.actuator;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import java.io.IOException;
import java.util.Map;
import java.util.concurrent.Callable;
@ -31,7 +27,6 @@ import org.junit.AfterClass; @@ -31,7 +27,6 @@ import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.springframework.boot.SpringApplication;
import sample.actuator.SampleActuatorApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
@ -39,6 +34,10 @@ import org.springframework.http.client.ClientHttpResponse; @@ -39,6 +34,10 @@ import org.springframework.http.client.ClientHttpResponse;
import org.springframework.web.client.DefaultResponseErrorHandler;
import org.springframework.web.client.RestTemplate;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
/**
* Integration tests for unsecured service endpoints (even with Spring Security on
* classpath).

1
spring-boot-samples/spring-boot-sample-actuator/src/test/java/sample/actuator/UnsecureSampleActuatorApplicationTests.java

@ -27,7 +27,6 @@ import org.junit.AfterClass; @@ -27,7 +27,6 @@ import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.springframework.boot.SpringApplication;
import sample.actuator.SampleActuatorApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;

3
spring-boot-samples/spring-boot-sample-aop/src/main/java/sample/aop/SampleAopApplication.java

@ -20,10 +20,11 @@ import org.springframework.beans.factory.annotation.Autowired; @@ -20,10 +20,11 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import sample.aop.service.HelloWorldService;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import sample.aop.service.HelloWorldService;
@Configuration
@EnableAutoConfiguration
@ComponentScan

1
spring-boot-samples/spring-boot-sample-aop/src/test/java/sample/aop/SampleAopApplicationTests.java

@ -22,7 +22,6 @@ import org.junit.Rule; @@ -22,7 +22,6 @@ import org.junit.Rule;
import org.junit.Test;
import org.springframework.boot.test.OutputCapture;
import sample.aop.SampleAopApplication;
import static org.junit.Assert.assertTrue;
/**

3
spring-boot-samples/spring-boot-sample-data-jpa/src/main/java/sample/data/jpa/service/CityRepository.java

@ -16,11 +16,12 @@ @@ -16,11 +16,12 @@
package sample.data.jpa.service;
import sample.data.jpa.domain.City;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.repository.Repository;
import sample.data.jpa.domain.City;
interface CityRepository extends Repository<City, Long> {
Page<City> findAll(Pageable pageable);

5
spring-boot-samples/spring-boot-sample-data-jpa/src/main/java/sample/data/jpa/service/CityService.java

@ -16,11 +16,12 @@ @@ -16,11 +16,12 @@
package sample.data.jpa.service;
import sample.data.jpa.domain.City;
import sample.data.jpa.domain.HotelSummary;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import sample.data.jpa.domain.City;
import sample.data.jpa.domain.HotelSummary;
public interface CityService {
Page<City> findCities(CitySearchCriteria criteria, Pageable pageable);

5
spring-boot-samples/spring-boot-sample-data-jpa/src/main/java/sample/data/jpa/service/CityServiceImpl.java

@ -17,8 +17,6 @@ @@ -17,8 +17,6 @@
package sample.data.jpa.service;
import org.springframework.beans.factory.annotation.Autowired;
import sample.data.jpa.domain.City;
import sample.data.jpa.domain.HotelSummary;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Component;
@ -26,6 +24,9 @@ import org.springframework.transaction.annotation.Transactional; @@ -26,6 +24,9 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.Assert;
import org.springframework.util.StringUtils;
import sample.data.jpa.domain.City;
import sample.data.jpa.domain.HotelSummary;
@Component("cityService")
@Transactional
class CityServiceImpl implements CityService {

5
spring-boot-samples/spring-boot-sample-data-jpa/src/main/java/sample/data/jpa/service/HotelService.java

@ -16,12 +16,13 @@ @@ -16,12 +16,13 @@
package sample.data.jpa.service;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import sample.data.jpa.domain.City;
import sample.data.jpa.domain.Hotel;
import sample.data.jpa.domain.Review;
import sample.data.jpa.domain.ReviewDetails;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
public interface HotelService {

11
spring-boot-samples/spring-boot-sample-data-jpa/src/main/java/sample/data/jpa/service/HotelServiceImpl.java

@ -21,17 +21,18 @@ import java.util.List; @@ -21,17 +21,18 @@ import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.Assert;
import sample.data.jpa.domain.City;
import sample.data.jpa.domain.Hotel;
import sample.data.jpa.domain.Rating;
import sample.data.jpa.domain.RatingCount;
import sample.data.jpa.domain.Review;
import sample.data.jpa.domain.ReviewDetails;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.Assert;
@Component("hotelService")
@Transactional

5
spring-boot-samples/spring-boot-sample-data-jpa/src/main/java/sample/data/jpa/service/ReviewRepository.java

@ -16,12 +16,13 @@ @@ -16,12 +16,13 @@
package sample.data.jpa.service;
import sample.data.jpa.domain.Hotel;
import sample.data.jpa.domain.Review;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.repository.Repository;
import sample.data.jpa.domain.Hotel;
import sample.data.jpa.domain.Review;
interface ReviewRepository extends Repository<Review, Long> {
Page<Review> findByHotel(Hotel hotel, Pageable pageable);

3
spring-boot-samples/spring-boot-sample-data-jpa/src/main/java/sample/data/jpa/web/SampleController.java

@ -17,12 +17,13 @@ @@ -17,12 +17,13 @@
package sample.data.jpa.web;
import org.springframework.beans.factory.annotation.Autowired;
import sample.data.jpa.service.CityService;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import sample.data.jpa.service.CityService;
@Controller
public class SampleController {

8
spring-boot-samples/spring-boot-sample-data-jpa/src/test/java/sample/data/jpa/SampleDataJpaApplicationTests.java

@ -1,9 +1,5 @@ @@ -1,9 +1,5 @@
package sample.data.jpa;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@ -16,6 +12,10 @@ import org.springframework.test.web.servlet.MockMvc; @@ -16,6 +12,10 @@ import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.web.context.WebApplicationContext;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
/**
* Integration test to run the application.
*

13
spring-boot-samples/spring-boot-sample-data-jpa/src/test/java/sample/data/jpa/service/CityRepositoryIntegrationTests.java

@ -15,20 +15,21 @@ @@ -15,20 +15,21 @@
*/
package sample.data.jpa.service;
import static org.hamcrest.Matchers.greaterThan;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import sample.data.jpa.SampleDataJpaApplication;
import sample.data.jpa.domain.City;
import org.springframework.boot.test.SpringApplicationConfiguration;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import sample.data.jpa.SampleDataJpaApplication;
import sample.data.jpa.domain.City;
import static org.hamcrest.Matchers.greaterThan;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;
/**
* Integration tests for {@link CityRepository}.
*

21
spring-boot-samples/spring-boot-sample-data-jpa/src/test/java/sample/data/jpa/service/HotelRepositoryIntegrationTests.java

@ -15,27 +15,28 @@ @@ -15,27 +15,28 @@
*/
package sample.data.jpa.service;
import static org.hamcrest.Matchers.greaterThan;
import static org.hamcrest.Matchers.hasSize;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;
import java.util.List;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.SpringApplicationConfiguration;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Sort.Direction;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import sample.data.jpa.SampleDataJpaApplication;
import sample.data.jpa.domain.City;
import sample.data.jpa.domain.Hotel;
import sample.data.jpa.domain.HotelSummary;
import sample.data.jpa.domain.Rating;
import sample.data.jpa.domain.RatingCount;
import org.springframework.boot.test.SpringApplicationConfiguration;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Sort.Direction;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import static org.hamcrest.Matchers.greaterThan;
import static org.hamcrest.Matchers.hasSize;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;
/**
* Integration tests for {@link HotelRepository}.

4
spring-boot-samples/spring-boot-sample-data-mongodb/src/test/java/sample/data/mongo/SampleMongoApplicationTests.java

@ -16,8 +16,6 @@ @@ -16,8 +16,6 @@
package sample.data.mongo;
import static org.junit.Assert.assertTrue;
import java.io.IOException;
import org.junit.Rule;
@ -25,6 +23,8 @@ import org.junit.Test; @@ -25,6 +23,8 @@ import org.junit.Test;
import org.springframework.boot.test.OutputCapture;
import org.springframework.core.NestedCheckedException;
import static org.junit.Assert.assertTrue;
/**
* Tests for {@link SampleMongoApplication}.
*

5
spring-boot-samples/spring-boot-sample-integration/src/test/java/sample/integration/consumer/SampleIntegrationApplicationTests.java

@ -25,14 +25,15 @@ import org.junit.AfterClass; @@ -25,14 +25,15 @@ import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.springframework.boot.SpringApplication;
import sample.integration.SampleIntegrationApplication;
import sample.integration.producer.ProducerApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.io.DefaultResourceLoader;
import org.springframework.core.io.Resource;
import org.springframework.core.io.support.ResourcePatternUtils;
import org.springframework.util.StreamUtils;
import sample.integration.SampleIntegrationApplication;
import sample.integration.producer.ProducerApplication;
import static org.junit.Assert.assertTrue;
/**

3
spring-boot-samples/spring-boot-sample-jetty/src/main/java/sample/jetty/web/SampleController.java

@ -17,11 +17,12 @@ @@ -17,11 +17,12 @@
package sample.jetty.web;
import org.springframework.beans.factory.annotation.Autowired;
import sample.jetty.service.HelloWorldService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import sample.jetty.service.HelloWorldService;
@Controller
public class SampleController {

3
spring-boot-samples/spring-boot-sample-profile/src/main/java/sample/profile/SampleProfileApplication.java

@ -20,10 +20,11 @@ import org.springframework.beans.factory.annotation.Autowired; @@ -20,10 +20,11 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import sample.profile.service.MessageService;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import sample.profile.service.MessageService;
@Configuration
@EnableAutoConfiguration
@ComponentScan

4
spring-boot-samples/spring-boot-sample-secure/src/test/java/sample/secure/SampleSecureApplicationTests.java

@ -16,8 +16,6 @@ @@ -16,8 +16,6 @@
package sample.secure;
import static org.junit.Assert.assertEquals;
import org.junit.After;
import org.junit.Test;
import org.junit.runner.RunWith;
@ -36,6 +34,8 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @@ -36,6 +34,8 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import sample.secure.SampleSecureApplicationTests.TestConfiguration;
import static org.junit.Assert.assertEquals;
/**
* Basic integration tests for demo application.
*

4
spring-boot-samples/spring-boot-sample-servlet/src/test/java/sample/servlet/SampleServletApplicationTests.java

@ -1,7 +1,5 @@ @@ -1,7 +1,5 @@
package sample.servlet;
import static org.junit.Assert.assertEquals;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
@ -28,6 +26,8 @@ import org.springframework.security.crypto.codec.Base64; @@ -28,6 +26,8 @@ import org.springframework.security.crypto.codec.Base64;
import org.springframework.web.client.DefaultResponseErrorHandler;
import org.springframework.web.client.RestTemplate;
import static org.junit.Assert.assertEquals;
/**
* Basic integration tests for demo application.
*

3
spring-boot-samples/spring-boot-sample-simple/src/main/java/sample/simple/SampleSimpleApplication.java

@ -20,10 +20,11 @@ import org.springframework.beans.factory.annotation.Autowired; @@ -20,10 +20,11 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import sample.simple.service.HelloWorldService;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import sample.simple.service.HelloWorldService;
@Configuration
@EnableAutoConfiguration
@ComponentScan

3
spring-boot-samples/spring-boot-sample-tomcat/src/main/java/sample/tomcat/web/SampleController.java

@ -17,11 +17,12 @@ @@ -17,11 +17,12 @@
package sample.tomcat.web;
import org.springframework.beans.factory.annotation.Autowired;
import sample.tomcat.service.HelloWorldService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import sample.tomcat.service.HelloWorldService;
@Controller
public class SampleController {

5
spring-boot-samples/spring-boot-sample-tomcat/src/test/java/sample/tomcat/NonAutoConfigurationSampleTomcatApplicationTests.java

@ -31,8 +31,6 @@ import org.springframework.boot.autoconfigure.web.DispatcherServletAutoConfigura @@ -31,8 +31,6 @@ import org.springframework.boot.autoconfigure.web.DispatcherServletAutoConfigura
import org.springframework.boot.autoconfigure.web.EmbeddedServletContainerAutoConfiguration;
import org.springframework.boot.autoconfigure.web.HttpMessageConvertersAutoConfiguration;
import org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration;
import sample.tomcat.service.HelloWorldService;
import sample.tomcat.web.SampleController;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
@ -43,6 +41,9 @@ import org.springframework.http.client.ClientHttpResponse; @@ -43,6 +41,9 @@ import org.springframework.http.client.ClientHttpResponse;
import org.springframework.web.client.DefaultResponseErrorHandler;
import org.springframework.web.client.RestTemplate;
import sample.tomcat.service.HelloWorldService;
import sample.tomcat.web.SampleController;
import static org.junit.Assert.assertEquals;
/**

3
spring-boot-samples/spring-boot-sample-web-jsp/src/test/java/sample/jsp/SampleWebJspApplicationTests.java

@ -17,7 +17,8 @@ import org.springframework.http.client.ClientHttpResponse; @@ -17,7 +17,8 @@ import org.springframework.http.client.ClientHttpResponse;
import org.springframework.web.client.DefaultResponseErrorHandler;
import org.springframework.web.client.RestTemplate;
import static org.junit.Assert.*;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
/**
* Basic integration tests for JSP application.

6
spring-boot-samples/spring-boot-sample-web-secure/src/test/java/sample/ops/ui/SampleSecureApplicationTests.java

@ -16,9 +16,6 @@ @@ -16,9 +16,6 @@
package sample.ops.ui;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import java.io.IOException;
import java.util.Arrays;
import java.util.concurrent.Callable;
@ -41,6 +38,9 @@ import org.springframework.http.client.ClientHttpResponse; @@ -41,6 +38,9 @@ import org.springframework.http.client.ClientHttpResponse;
import org.springframework.web.client.DefaultResponseErrorHandler;
import org.springframework.web.client.RestTemplate;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
/**
* Basic integration tests for demo application.
*

3
spring-boot-samples/spring-boot-sample-web-static/src/test/java/sample/ui/SampleWebStaticApplicationTests.java

@ -63,7 +63,8 @@ public class SampleWebStaticApplicationTests { @@ -63,7 +63,8 @@ public class SampleWebStaticApplicationTests {
@Test
public void testCss() throws Exception {
ResponseEntity<String> entity = getRestTemplate().getForEntity(
"http://localhost:8080/webjars/bootstrap/3.0.3/css/bootstrap.min.css", String.class);
"http://localhost:8080/webjars/bootstrap/3.0.3/css/bootstrap.min.css",
String.class);
assertEquals(HttpStatus.OK, entity.getStatusCode());
assertTrue("Wrong body:\n" + entity.getBody(), entity.getBody().contains("body"));
assertEquals("Wrong content type:\n" + entity.getHeaders().getContentType(),

5
spring-boot-samples/spring-boot-sample-web-ui/src/main/java/sample/ui/mvc/MessageController.java

@ -16,8 +16,6 @@ package sample.ui.mvc; @@ -16,8 +16,6 @@ package sample.ui.mvc;
import javax.validation.Valid;
import org.springframework.beans.factory.annotation.Autowired;
import sample.ui.Message;
import sample.ui.MessageRepository;
import org.springframework.stereotype.Controller;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.ModelAttribute;
@ -27,6 +25,9 @@ import org.springframework.web.bind.annotation.RequestMethod; @@ -27,6 +25,9 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import sample.ui.Message;
import sample.ui.MessageRepository;
/**
* @author Rob Winch
*/

14
spring-boot-samples/spring-boot-sample-web-ui/src/test/java/sample/ui/MessageControllerWebTests.java

@ -1,12 +1,5 @@ @@ -1,12 +1,5 @@
package sample.ui;
import static org.hamcrest.Matchers.containsString;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.header;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
import java.util.regex.Pattern;
import org.hamcrest.Description;
@ -22,6 +15,13 @@ import org.springframework.test.web.servlet.MockMvc; @@ -22,6 +15,13 @@ import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.web.context.WebApplicationContext;
import static org.hamcrest.Matchers.containsString;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.header;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
/**
* A Basic Spring MVC Test for the Sample Controller"
*

11
spring-boot-samples/spring-boot-sample-websocket/src/main/java/samples/websocket/config/SampleWebSocketsApplication.java

@ -19,17 +19,18 @@ package samples.websocket.config; @@ -19,17 +19,18 @@ package samples.websocket.config;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.SpringBootServletInitializer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.socket.WebSocketHandler;
import org.springframework.web.socket.handler.PerConnectionWebSocketHandler;
import samples.websocket.client.GreetingService;
import samples.websocket.client.SimpleGreetingService;
import samples.websocket.echo.DefaultEchoService;
import samples.websocket.echo.EchoService;
import samples.websocket.echo.EchoWebSocketHandler;
import samples.websocket.snake.SnakeWebSocketHandler;
import org.springframework.boot.web.SpringBootServletInitializer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.socket.WebSocketHandler;
import org.springframework.web.socket.handler.PerConnectionWebSocketHandler;
@Configuration
@EnableAutoConfiguration

12
spring-boot-samples/spring-boot-sample-websocket/src/main/java/samples/websocket/snake/Location.java

@ -49,17 +49,21 @@ public class Location { @@ -49,17 +49,21 @@ public class Location {
@Override
public boolean equals(Object o) {
if (this == o)
if (this == o) {
return true;
if (o == null || getClass() != o.getClass())
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Location location = (Location) o;
if (this.x != location.x)
if (this.x != location.x) {
return false;
if (this.y != location.y)
}
if (this.y != location.y) {
return false;
}
return true;
}

9
spring-boot-samples/spring-boot-sample-websocket/src/test/java/samples/websocket/echo/SampleWebSocketsApplicationTests.java

@ -29,16 +29,17 @@ import org.junit.BeforeClass; @@ -29,16 +29,17 @@ import org.junit.BeforeClass;
import org.junit.Test;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import samples.websocket.client.GreetingService;
import samples.websocket.client.SimpleClientWebSocketHandler;
import samples.websocket.client.SimpleGreetingService;
import samples.websocket.config.SampleWebSocketsApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.socket.client.WebSocketConnectionManager;
import org.springframework.web.socket.client.standard.StandardWebSocketClient;
import samples.websocket.client.GreetingService;
import samples.websocket.client.SimpleClientWebSocketHandler;
import samples.websocket.client.SimpleGreetingService;
import samples.websocket.config.SampleWebSocketsApplication;
import static org.junit.Assert.assertEquals;
public class SampleWebSocketsApplicationTests {

1
spring-boot-samples/spring-boot-sample-xml/src/main/java/sample/xml/SampleSpringXmlApplication.java

@ -19,6 +19,7 @@ package sample.xml; @@ -19,6 +19,7 @@ package sample.xml;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import sample.xml.service.HelloWorldService;
public class SampleSpringXmlApplication implements CommandLineRunner {

4
spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/task/ProjectLibraries.java

@ -28,7 +28,7 @@ import org.springframework.boot.loader.tools.LibraryScope; @@ -28,7 +28,7 @@ import org.springframework.boot.loader.tools.LibraryScope;
/**
* Expose Gradle {@link Configuration}s as {@link Libraries}.
*
*
* @author Phillip Webb
*/
class ProjectLibraries implements Libraries {
@ -41,6 +41,7 @@ class ProjectLibraries implements Libraries { @@ -41,6 +41,7 @@ class ProjectLibraries implements Libraries {
/**
* Create a new {@link ProjectLibraries} instance of the specified {@link Project}.
*
* @param project the gradle project
*/
public ProjectLibraries(Project project) {
@ -49,6 +50,7 @@ class ProjectLibraries implements Libraries { @@ -49,6 +50,7 @@ class ProjectLibraries implements Libraries {
/**
* Set the name of the provided configuration. Defaults to 'providedRuntime'.
*
* @param providedConfigurationName the providedConfigurationName to set
*/
public void setProvidedConfigurationName(String providedConfigurationName) {

13
spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/task/Repackage.java

@ -30,7 +30,7 @@ import org.springframework.boot.loader.tools.Repackager; @@ -30,7 +30,7 @@ import org.springframework.boot.loader.tools.Repackager;
/**
* Repackage task.
*
*
* @author Phillip Webb
*/
public class Repackage extends DefaultTask {
@ -78,13 +78,16 @@ public class Repackage extends DefaultTask { @@ -78,13 +78,16 @@ public class Repackage extends DefaultTask {
File file = archive.getArchivePath();
if (file.exists()) {
Repackager repackager = new Repackager(file) {
protected String findMainMethod(java.util.jar.JarFile source) throws IOException {
@Override
protected String findMainMethod(java.util.jar.JarFile source)
throws IOException {
long startTime = System.currentTimeMillis();
try {
return super.findMainMethod(source);
}
finally {
long duration = System.currentTimeMillis() - startTime;
} finally {
long duration = System.currentTimeMillis()
- startTime;
if (duration > FIND_WARNING_TIMEOUT) {
getLogger().warn(
"Searching for the main-class is taking some time, "

8
spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/task/RunApp.java

@ -50,6 +50,8 @@ public class RunApp extends DefaultTask { @@ -50,6 +50,8 @@ public class RunApp extends DefaultTask {
JavaPluginConvention javaConvention = project.getConvention().getPlugin(
JavaPluginConvention.class);
javaConvention.getSourceSets().all(new Action<SourceSet>() {
@Override
public void execute(SourceSet set) {
if (SourceSet.MAIN_SOURCE_SET_NAME.equals(set.getName())) {
main = set;
@ -64,10 +66,11 @@ public class RunApp extends DefaultTask { @@ -64,10 +66,11 @@ public class RunApp extends DefaultTask {
}
project.getTasks().withType(JavaExec.class, new Action<JavaExec>() {
@Override
public void execute(JavaExec exec) {
ArrayList<File> files = new ArrayList<File>(exec.getClasspath()
.getFiles());
ArrayList<File> files = new ArrayList<File>(
exec.getClasspath().getFiles());
files.addAll(0, allResources);
getLogger().info("Adding classpath: " + allResources);
exec.setClasspath(new SimpleFileCollection(files));
@ -75,6 +78,7 @@ public class RunApp extends DefaultTask { @@ -75,6 +78,7 @@ public class RunApp extends DefaultTask {
final String mainClass = findMainClass(main);
exec.setMain(mainClass);
exec.getConventionMapping().map("main", new Callable<String>() {
@Override
public String call() throws Exception {
return mainClass;

3
spring-boot-tools/spring-boot-loader-tools/src/test/java/org/springframework/boot/loader/tools/LayoutsTests.java

@ -21,9 +21,6 @@ import java.io.File; @@ -21,9 +21,6 @@ import java.io.File;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.springframework.boot.loader.tools.Layout;
import org.springframework.boot.loader.tools.Layouts;
import org.springframework.boot.loader.tools.LibraryScope;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.instanceOf;

1
spring-boot-tools/spring-boot-maven-plugin/src/test/java/org/springframework/boot/maven/PropertiesMergingResourceTransformerTests.java

@ -21,7 +21,6 @@ import java.io.ByteArrayOutputStream; @@ -21,7 +21,6 @@ import java.io.ByteArrayOutputStream;
import java.util.jar.JarOutputStream;
import org.junit.Test;
import org.springframework.boot.maven.PropertiesMergingResourceTransformer;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;

3
spring-boot/src/main/java/org/springframework/boot/bind/RelaxedNames.java

@ -139,10 +139,11 @@ public final class RelaxedNames implements Iterable<String> { @@ -139,10 +139,11 @@ public final class RelaxedNames implements Iterable<String> {
builder.append(builder.length() == 0 ? field : StringUtils
.capitalize(field));
}
for (String suffix : new String[] { "_", "-", "." })
for (String suffix : new String[] { "_", "-", "." }) {
if (value.endsWith(suffix)) {
builder.append(suffix);
}
}
return builder.toString();
}
};

6
spring-boot/src/test/java/org/springframework/boot/ansi/AnsiOutputTest.java

@ -19,18 +19,16 @@ package org.springframework.boot.ansi; @@ -19,18 +19,16 @@ package org.springframework.boot.ansi;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.springframework.boot.ansi.AnsiOutput;
import org.springframework.boot.ansi.AnsiOutput.Enabled;
import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertThat;
import static org.springframework.boot.ansi.AnsiElement.BOLD;
import static org.springframework.boot.ansi.AnsiElement.FAINT;
import static org.springframework.boot.ansi.AnsiElement.GREEN;
import static org.springframework.boot.ansi.AnsiElement.NORMAL;
import static org.springframework.boot.ansi.AnsiElement.RED;
import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertThat;
/**
* Tests for {@link AnsiOutput}.
*

1
spring-boot/src/test/java/org/springframework/boot/config/ArrayDocumentMatcherTests.java

@ -20,7 +20,6 @@ import java.io.IOException; @@ -20,7 +20,6 @@ import java.io.IOException;
import java.util.Properties;
import org.junit.Test;
import org.springframework.boot.config.ArrayDocumentMatcher;
import org.springframework.boot.config.YamlProcessor.MatchStatus;
import org.springframework.core.io.ByteArrayResource;
import org.springframework.core.io.support.PropertiesLoaderUtils;

1
spring-boot/src/test/java/org/springframework/boot/context/embedded/MimeMappingsTests.java

@ -29,7 +29,6 @@ import org.junit.Test; @@ -29,7 +29,6 @@ import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
import org.springframework.boot.context.embedded.MimeMappings;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.nullValue;

2
spring-boot/src/test/java/org/springframework/boot/context/embedded/jetty/JettyEmbeddedServletContainerFactoryTests.java

@ -25,8 +25,6 @@ import org.eclipse.jetty.webapp.WebAppContext; @@ -25,8 +25,6 @@ import org.eclipse.jetty.webapp.WebAppContext;
import org.junit.Test;
import org.mockito.InOrder;
import org.springframework.boot.context.embedded.AbstractEmbeddedServletContainerFactoryTests;
import org.springframework.boot.context.embedded.jetty.JettyEmbeddedServletContainer;
import org.springframework.boot.context.embedded.jetty.JettyEmbeddedServletContainerFactory;
import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertThat;

2
spring-boot/src/test/java/org/springframework/boot/logging/logback/ColorConverterTests.java

@ -23,10 +23,10 @@ import org.junit.Before; @@ -23,10 +23,10 @@ import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.springframework.boot.ansi.AnsiOutput;
import org.springframework.boot.logging.logback.ColorConverter;
import ch.qos.logback.classic.Level;
import ch.qos.logback.classic.spi.LoggingEvent;
import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertThat;

Loading…
Cancel
Save