Merge pull request #8148 from izeye:polish-20170131

* pr/8148:
  Polish
pull/8206/head
Stephane Nicoll 8 years ago
commit 9b952dd3a8

@ -44,7 +44,7 @@ public class AutoConfigurationImportEvent extends EventObject {
/** /**
* Return the auto-configuration candidate configurations that are going to be * Return the auto-configuration candidate configurations that are going to be
* imported. * imported.
* @return the configurations the auto-configuration candidates * @return the auto-configuration candidates
*/ */
public List<String> getCandidateConfigurations() { public List<String> getCandidateConfigurations() {
return this.candidateConfigurations; return this.candidateConfigurations;
@ -52,7 +52,7 @@ public class AutoConfigurationImportEvent extends EventObject {
/** /**
* Return the exclusions that were applied. * Return the exclusions that were applied.
* @return the exclusions the exclusions applied * @return the exclusions applied
*/ */
public Set<String> getExclusions() { public Set<String> getExclusions() {
return this.exclusions; return this.exclusions;

@ -99,7 +99,7 @@ public class AutoConfigurationImportSelector
checkExcludedClasses(configurations, exclusions); checkExcludedClasses(configurations, exclusions);
configurations.removeAll(exclusions); configurations.removeAll(exclusions);
configurations = filter(configurations, autoConfigurationMetadata); configurations = filter(configurations, autoConfigurationMetadata);
fireAutoConfigurationImportListeners(configurations, exclusions); fireAutoConfigurationImportEvents(configurations, exclusions);
return configurations.toArray(new String[configurations.size()]); return configurations.toArray(new String[configurations.size()]);
} }
catch (IOException ex) { catch (IOException ex) {
@ -300,7 +300,7 @@ public class AutoConfigurationImportSelector
return Arrays.asList(value == null ? new String[0] : value); return Arrays.asList(value == null ? new String[0] : value);
} }
private void fireAutoConfigurationImportListeners(List<String> configurations, private void fireAutoConfigurationImportEvents(List<String> configurations,
Set<String> exclusions) { Set<String> exclusions) {
List<AutoConfigurationImportListener> listeners = getAutoConfigurationImportListeners(); List<AutoConfigurationImportListener> listeners = getAutoConfigurationImportListeners();
if (!listeners.isEmpty()) { if (!listeners.isEmpty()) {

@ -18,7 +18,6 @@ package org.springframework.boot.autoconfigure;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import org.mockito.MockitoAnnotations;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.beans.factory.support.DefaultListableBeanFactory; import org.springframework.beans.factory.support.DefaultListableBeanFactory;
@ -46,7 +45,6 @@ public class EnableAutoConfigurationImportSelectorTests {
@Before @Before
public void setup() { public void setup() {
MockitoAnnotations.initMocks(this);
this.importSelector.setBeanFactory(this.beanFactory); this.importSelector.setBeanFactory(this.beanFactory);
this.importSelector.setEnvironment(this.environment); this.importSelector.setEnvironment(this.environment);
this.importSelector.setResourceLoader(new DefaultResourceLoader()); this.importSelector.setResourceLoader(new DefaultResourceLoader());

@ -3080,7 +3080,7 @@ application's main class to extend `SpringBootServletInitializer`:
The next step is to update your build configuration so that your project produces a war file The next step is to update your build configuration so that your project produces a war file
rather than a jar file. If you're using Maven and using `spring-boot-starter-parent` (which rather than a jar file. If you're using Maven and using `spring-boot-starter-parent` (which
configures Maven's war plugin for you) all you need to do is modify `pom.xml` to change the configures Maven's war plugin for you) all you need to do is to modify `pom.xml` to change the
packaging to war: packaging to war:
[source,xml,indent=0,subs="verbatim,quotes,attributes"] [source,xml,indent=0,subs="verbatim,quotes,attributes"]

@ -1221,7 +1221,7 @@ In addition, any `MetricReader` that you define and mark as `@ExportMetricReader
have its values exported by the default exporter. have its values exported by the default exporter.
NOTE: This feature is enabling scheduling in your application (`@EnableScheduling`) which NOTE: This feature is enabling scheduling in your application (`@EnableScheduling`) which
can be a problem if you run an integration tests as your own scheduled tasks will start. can be a problem if you run an integration test as your own scheduled tasks will start.
You can disable this behaviour by setting `spring.metrics.export.enabled` to `false`. You can disable this behaviour by setting `spring.metrics.export.enabled` to `false`.
The default exporter is a `MetricCopyExporter` which tries to optimize itself by not The default exporter is a `MetricCopyExporter` which tries to optimize itself by not

@ -1091,7 +1091,7 @@ only rely on custom converters qualified with `@ConfigurationPropertiesBinding`.
[[boot-features-external-config-validation]] [[boot-features-external-config-validation]]
==== @ConfigurationProperties Validation ==== @ConfigurationProperties Validation
Spring Boot will attempt to validate `@ConfigurationProperties` classes whenever they Spring Boot will attempt to validate `@ConfigurationProperties` classes whenever they
annotated with Spring's `@Validated` annotation. You can use JSR-303 `javax.validation` are annotated with Spring's `@Validated` annotation. You can use JSR-303 `javax.validation`
constraint annotations directly on your configuration class. Simply ensure that a constraint annotations directly on your configuration class. Simply ensure that a
compliant JSR-303 implementation is on your classpath, then add constraint annotations to compliant JSR-303 implementation is on your classpath, then add constraint annotations to
your fields: your fields:
@ -5394,7 +5394,7 @@ more `@AutoConfigure...` annotations that can be used to customize auto-configur
settings. settings.
NOTE: Each slice loads a very restricted set of auto-configuration classes. If you need to NOTE: Each slice loads a very restricted set of auto-configuration classes. If you need to
exclude one of them, most `@...Test` annotation provide an `excludeAutoConfiguration` exclude one of them, most `@...Test` annotations provide an `excludeAutoConfiguration`
attribute. Alternatively, you can use `@ImportAutoConfiguration#exclude`. attribute. Alternatively, you can use `@ImportAutoConfiguration#exclude`.
TIP: It's also possible to use the `@AutoConfigure...` annotations with the standard TIP: It's also possible to use the `@AutoConfigure...` annotations with the standard
@ -5720,7 +5720,7 @@ for `@Document` classes and configure Spring Data MongoDB repositories. Regular
In-memory embedded MongoDB generally works well for tests since it is fast and doesn't In-memory embedded MongoDB generally works well for tests since it is fast and doesn't
require any developer installation. If, however, you prefer to run tests against a real require any developer installation. If, however, you prefer to run tests against a real
MongoDB server you should exclude the embedded mongodb auto-configuration: MongoDB server you should exclude the embedded MongoDB auto-configuration:
[source,java,indent=0] [source,java,indent=0]
---- ----

@ -1141,7 +1141,7 @@ IDEA suspend the entire VM rather than only suspending the thread that hit the
breakpoint. This has the unwanted side-effect of suspending the thread that manages the breakpoint. This has the unwanted side-effect of suspending the thread that manages the
remote debug tunnel, causing your debugging session to freeze. When using the remote remote debug tunnel, causing your debugging session to freeze. When using the remote
debug tunnel with IntelliJ IDEA, all breakpoints should be configured to suspend the debug tunnel with IntelliJ IDEA, all breakpoints should be configured to suspend the
thread rather than the VM. Please set thread rather than the VM. Please see
https://youtrack.jetbrains.com/issue/IDEA-165769[IDEA-165769] for further details. https://youtrack.jetbrains.com/issue/IDEA-165769[IDEA-165769] for further details.

@ -60,7 +60,7 @@ public class DataMongoTestIntegrationTests {
} }
@Test @Test
public void didNotInjectExampleController() { public void didNotInjectExampleService() {
this.thrown.expect(NoSuchBeanDefinitionException.class); this.thrown.expect(NoSuchBeanDefinitionException.class);
this.applicationContext.getBean(ExampleService.class); this.applicationContext.getBean(ExampleService.class);
} }

@ -39,7 +39,7 @@ public class DataMongoTestWithIncludeFilterIntegrationTests {
private ExampleService service; private ExampleService service;
@Test @Test
public void testRepository() { public void testService() {
assertThat(this.service.hasCollection("foobar")).isFalse(); assertThat(this.service.hasCollection("foobar")).isFalse();
} }

@ -33,7 +33,7 @@ public class ExampleService {
this.mongoTemplate = mongoTemplate; this.mongoTemplate = mongoTemplate;
} }
public boolean hasCollection(final String collectionName) { public boolean hasCollection(String collectionName) {
return this.mongoTemplate.collectionExists(collectionName); return this.mongoTemplate.collectionExists(collectionName);
} }

@ -72,11 +72,11 @@ public class TestDatabaseAutoConfigurationTests {
} }
} }
public void load(Class<?> config, String... environment) { private void load(Class<?> config, String... environment) {
this.context = doLoad(config, environment); this.context = doLoad(config, environment);
} }
public ConfigurableApplicationContext doLoad(Class<?> config, String... environment) { private ConfigurableApplicationContext doLoad(Class<?> config, String... environment) {
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(); AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
if (config != null) { if (config != null) {
ctx.register(config); ctx.register(config);

Loading…
Cancel
Save