> getDefaultIncludes();
- protected static enum FilterType {
+ protected enum FilterType {
+
INCLUDE, EXCLUDE
+
};
}
diff --git a/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/filter/TypeExcludeFilters.java b/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/filter/TypeExcludeFilters.java
index 40d7270a6e..0bfa41208e 100644
--- a/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/filter/TypeExcludeFilters.java
+++ b/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/filter/TypeExcludeFilters.java
@@ -45,6 +45,7 @@ public @interface TypeExcludeFilters {
* specified here can either have a no-arg constructor or accept a single
* {@code Class>} argument if then need access to the {@code testClass}.
* @see TypeExcludeFilter
+ * @return the type exclude filters to apply
*/
Class extends TypeExcludeFilter>[] value();
diff --git a/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/json/AutoConfigureJsonTesters.java b/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/json/AutoConfigureJsonTesters.java
index 9da8de5209..8790caae51 100644
--- a/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/json/AutoConfigureJsonTesters.java
+++ b/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/json/AutoConfigureJsonTesters.java
@@ -52,6 +52,7 @@ public @interface AutoConfigureJsonTesters {
/**
* If {@link BasicJsonTester}, {@link JacksonTester} and {@link GsonTester} fields
* should be initialized using marshallers from the {@link ApplicationContext}.
+ * @return if JSON tester fields should be initialized
*/
boolean initFields() default true;
diff --git a/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/json/JsonTest.java b/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/json/JsonTest.java
index 6f0620e262..2f85bbc9dc 100644
--- a/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/json/JsonTest.java
+++ b/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/json/JsonTest.java
@@ -47,18 +47,22 @@ public @interface JsonTest {
* {@code @JsonComponent} and {@code Module} beans are included.
* @see #includeFilters()
* @see #excludeFilters()
+ * @return if default filters should be used
*/
boolean useDefaultFilters() default true;
/**
* A set of include filters which can be used to add otherwise filtered beans to the
* application context.
+ * @return include filters to apply
*/
Filter[] includeFilters() default {};
/**
* A set of exclude filters which can be used to filter beans that would otherwise be
* added to the application context.
+ * @return exclude filters to apply
*/
Filter[] excludeFilters() default {};
+
}
diff --git a/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/orm/jpa/AutoConfigureTestDatabase.java b/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/orm/jpa/AutoConfigureTestDatabase.java
index 51ab895eee..368db06e9d 100644
--- a/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/orm/jpa/AutoConfigureTestDatabase.java
+++ b/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/orm/jpa/AutoConfigureTestDatabase.java
@@ -43,13 +43,15 @@ import org.springframework.boot.test.autoconfigure.properties.PropertyMapping;
public @interface AutoConfigureTestDatabase {
/**
- * If the test database should replace any existing.
+ * Determines what type of existing DataSource beans can be replaced.
+ * @return the type of existing DataSource to replace
*/
Replace replace() default Replace.ANY;
/**
* The type of connection to be establish when {@link #replace() replacing} the data
* source. By default will attempt to detect the connection based on the classpath.
+ * @return the type of connection to use
*/
EmbeddedDatabaseConnection connection() default EmbeddedDatabaseConnection.NONE;
diff --git a/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/orm/jpa/DataJpaTest.java b/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/orm/jpa/DataJpaTest.java
index 3fa3466656..e10fd09118 100644
--- a/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/orm/jpa/DataJpaTest.java
+++ b/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/orm/jpa/DataJpaTest.java
@@ -69,6 +69,7 @@ public @interface DataJpaTest {
/**
* If SQL output should be logged.
+ * @return if SQL is logged
*/
@PropertyMapping("spring.jpa.show-sql")
boolean showSql() default true;
@@ -79,18 +80,21 @@ public @interface DataJpaTest {
* included.
* @see #includeFilters()
* @see #excludeFilters()
+ * @return if default filters should be used
*/
boolean useDefaultFilters() default true;
/**
* A set of include filters which can be used to add otherwise filtered beans to the
* application context.
+ * @return include filters to apply
*/
Filter[] includeFilters() default {};
/**
* A set of exclude filters which can be used to filter beans that would otherwise be
* added to the application context.
+ * @return exclude filters to apply
*/
Filter[] excludeFilters() default {};
diff --git a/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/properties/PropertyMapping.java b/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/properties/PropertyMapping.java
index 2796fd4056..e2b374c42e 100644
--- a/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/properties/PropertyMapping.java
+++ b/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/properties/PropertyMapping.java
@@ -58,6 +58,7 @@ public @interface PropertyMapping {
* Defines the property mapping. When used at the type-level, this value will be used
* as a prefix for all mapped attributes. When used on an attribute, the value
* overrides the generated (kebab case) name.
+ * @return the property mapping
*/
String value() default "";
@@ -65,6 +66,7 @@ public @interface PropertyMapping {
* Determines if mapping should occur. When specified at the type-level indicates if
* mapping should occur by default or not. When used at the attribute-level, overrides
* the type-level default.
+ * @return if mapping should occur
*/
boolean map() default true;
diff --git a/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/AutoConfigureMockMvc.java b/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/AutoConfigureMockMvc.java
index f5bbd1025f..d141649b90 100644
--- a/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/AutoConfigureMockMvc.java
+++ b/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/AutoConfigureMockMvc.java
@@ -51,18 +51,21 @@ public @interface AutoConfigureMockMvc {
/**
* If filters from the application context should be registered with MockMVC. Defaults
* to {@code true}.
+ * @return if filters should be added
*/
boolean addFilters() default true;
/**
* If {@link MvcResult} information should always be printed after each MockMVC
* invocation. Defaults to {@code true}.
+ * @return if result information is always printed
*/
boolean alwaysPrint() default true;
/**
* If a {@link WebClient} should be auto-configured when HtmlUnit is on the classpath.
* Defaults to {@code true}.
+ * @return if a {@link WebClient} is auto-configured
*/
@PropertyMapping("webclient.enabled")
boolean webClientEnabled() default true;
@@ -70,6 +73,7 @@ public @interface AutoConfigureMockMvc {
/**
* If a {@link WebDriver} should be auto-configured when Selenium is on the classpath.
* Defaults to {@code true}.
+ * @return if a {@link WebDriver} is auto-configured
*/
@PropertyMapping("webdriver.enabled")
boolean webDriverEnabled() default true;
diff --git a/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/WebMvcTest.java b/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/WebMvcTest.java
index 9aedc6768c..69963e3f40 100644
--- a/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/WebMvcTest.java
+++ b/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/WebMvcTest.java
@@ -78,6 +78,7 @@ public @interface WebMvcTest {
* can be used for brevity if no other attributes are defined. See
* {@link #controllers()} for details.
* @see #controllers()
+ * @return the controllers to test
*/
@AliasFor("controllers")
Class>[] value() default {};
@@ -86,6 +87,7 @@ public @interface WebMvcTest {
* Specifies the controllers to test. May be left blank if all {@code @Controller}
* beans should be added to the application context.
* @see #value()
+ * @return the controllers to test
*/
@AliasFor("value")
Class>[] controllers() default {};
@@ -98,18 +100,21 @@ public @interface WebMvcTest {
* included.
* @see #includeFilters()
* @see #excludeFilters()
+ * @return if default filters should be used
*/
boolean useDefaultFilters() default true;
/**
* A set of include filters which can be used to add otherwise filtered beans to the
* application context.
+ * @return include filters to apply
*/
Filter[] includeFilters() default {};
/**
* A set of exclude filters which can be used to filter beans that would otherwise be
* added to the application context.
+ * @return exclude filters to apply
*/
Filter[] excludeFilters() default {};
diff --git a/spring-boot-test/src/main/java/org/springframework/boot/test/context/SpringApplicationTest.java b/spring-boot-test/src/main/java/org/springframework/boot/test/context/SpringApplicationTest.java
index b974818596..88102f5c7c 100644
--- a/spring-boot-test/src/main/java/org/springframework/boot/test/context/SpringApplicationTest.java
+++ b/spring-boot-test/src/main/java/org/springframework/boot/test/context/SpringApplicationTest.java
@@ -61,6 +61,7 @@ public @interface SpringApplicationTest {
/**
* Properties in form {@literal key=value} that should be added to the Spring
* {@link Environment} before the test runs.
+ * @return the properties to add
*/
String[] value() default {};
diff --git a/spring-boot-test/src/main/java/org/springframework/boot/test/context/TestComponent.java b/spring-boot-test/src/main/java/org/springframework/boot/test/context/TestComponent.java
index 0e5c25be62..a4c7c26ef8 100644
--- a/spring-boot-test/src/main/java/org/springframework/boot/test/context/TestComponent.java
+++ b/spring-boot-test/src/main/java/org/springframework/boot/test/context/TestComponent.java
@@ -48,6 +48,7 @@ public @interface TestComponent {
/**
* The value may indicate a suggestion for a logical component name, to be turned into
* a Spring bean in case of an auto-detected component.
+ * @return the specified bean name, if any
*/
String value() default "";
diff --git a/spring-boot-test/src/main/java/org/springframework/boot/test/context/TestConfiguration.java b/spring-boot-test/src/main/java/org/springframework/boot/test/context/TestConfiguration.java
index 89cf5fba93..9a274db4ab 100644
--- a/spring-boot-test/src/main/java/org/springframework/boot/test/context/TestConfiguration.java
+++ b/spring-boot-test/src/main/java/org/springframework/boot/test/context/TestConfiguration.java
@@ -45,6 +45,7 @@ public @interface TestConfiguration {
/**
* Explicitly specify the name of the Spring bean definition associated with this
* Configuration class. See {@link Configuration#value()} for details.
+ * @return the specified bean name, if any
*/
String value() default "";
diff --git a/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/MockBean.java b/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/MockBean.java
index a6c4c5d9b6..aa019af7b3 100644
--- a/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/MockBean.java
+++ b/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/MockBean.java
@@ -85,12 +85,14 @@ public @interface MockBean {
* The name of the bean that should be registered with the application context. If not
* specified the name will either be generated or, if the mock replaces an existing
* bean, the existing name will be used.
+ * @return the name of the bean
*/
String name() default "";
/**
* The classes to mock. This is an alias of {@link #classes()} which can be used for
* brevity if no other attributes are defined. See {@link #classes()} for details.
+ * @return the classes to mock
*/
@AliasFor("classes")
Class>[] value() default {};
@@ -105,6 +107,7 @@ public @interface MockBean {
*
* If this is the only attribute specified consider using the {@code value} alias
* instead.
+ * @return the classes to mock
*/
@AliasFor("value")
Class>[] classes() default {};
@@ -112,23 +115,27 @@ public @interface MockBean {
/**
* Any extra interfaces that should also be declared on the mock. See
* {@link MockSettings#extraInterfaces(Class...)} for details.
+ * @return any extra interfaces
*/
Class>[] extraInterfaces() default {};
/**
* The {@link Answers} type to use on the mock.
+ * @return the answer type
*/
Answers answer() default Answers.RETURNS_DEFAULTS;
/**
* If the generated mock is serializable. See {@link MockSettings#serializable()} for
* details.
+ * @return if the mock is serializable
*/
boolean serializable() default false;
/**
* The reset mode to apply to the mock bean. The default is {@link MockReset#AFTER}
* meaning that mocks are automatically reset after each test method is invoked.
+ * @return the reset mode
*/
MockReset reset() default MockReset.AFTER;
diff --git a/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/MockBeans.java b/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/MockBeans.java
index a24cd2779b..72286a2990 100644
--- a/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/MockBeans.java
+++ b/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/MockBeans.java
@@ -40,6 +40,7 @@ public @interface MockBeans {
/**
* Return the contained {@link MockBean} annotations.
+ * @return the mock beans
*/
MockBean[] value();
diff --git a/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/repackage/RepackageTask.java b/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/repackage/RepackageTask.java
index da068e4ca0..258571f0b1 100644
--- a/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/repackage/RepackageTask.java
+++ b/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/repackage/RepackageTask.java
@@ -240,30 +240,31 @@ public class RepackageTask extends DefaultTask {
}
private void setMainClass(Repackager repackager) {
- String mainClass;
- if (getProject().hasProperty("mainClassName")) {
- mainClass = (String) getProject().property("mainClassName");
- }
- else {
- ExtraPropertiesExtension extraProperties = (ExtraPropertiesExtension) getProject()
- .getExtensions().getByName("ext");
- mainClass = (String) extraProperties.get("mainClassName");
- }
+ String mainClassName = getMainClassNameProperty();
if (RepackageTask.this.mainClass != null) {
- mainClass = RepackageTask.this.mainClass;
+ mainClassName = RepackageTask.this.mainClass;
}
else if (this.extension.getMainClass() != null) {
- mainClass = this.extension.getMainClass();
+ mainClassName = this.extension.getMainClass();
}
else {
Task runTask = getProject().getTasks().findByName("run");
if (runTask != null && runTask.hasProperty("main")) {
- mainClass = (String) getProject().getTasks().getByName("run")
+ mainClassName = (String) getProject().getTasks().getByName("run")
.property("main");
}
}
- getLogger().info("Setting mainClass: " + mainClass);
- repackager.setMainClass(mainClass);
+ getLogger().info("Setting mainClass: " + mainClassName);
+ repackager.setMainClass(mainClassName);
+ }
+
+ private String getMainClassNameProperty() {
+ if (getProject().hasProperty("mainClassName")) {
+ return (String) getProject().property("mainClassName");
+ }
+ ExtraPropertiesExtension extraProperties = (ExtraPropertiesExtension) getProject()
+ .getExtensions().getByName("ext");
+ return (String) extraProperties.get("mainClassName");
}
private LaunchScript getLaunchScript() throws IOException {
diff --git a/spring-boot/src/main/java/org/springframework/boot/jackson/JsonComponent.java b/spring-boot/src/main/java/org/springframework/boot/jackson/JsonComponent.java
index 054348c66d..48726f28f0 100644
--- a/spring-boot/src/main/java/org/springframework/boot/jackson/JsonComponent.java
+++ b/spring-boot/src/main/java/org/springframework/boot/jackson/JsonComponent.java
@@ -65,6 +65,7 @@ public @interface JsonComponent {
/**
* The value may indicate a suggestion for a logical component name, to be turned into
* a Spring bean in case of an autodetected component.
+ * @return the component name
*/
String value() default "";