Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
893a6c32
Commit
893a6c32
authored
Mar 31, 2016
by
Phillip Webb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upgrade to checkstyle 6.17
Fixes gh-5547
parent
4f200a85
Changes
23
Show whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
67 additions
and
43 deletions
+67
-43
DataSourceAutoConfigurationTests.java
.../autoconfigure/jdbc/DataSourceAutoConfigurationTests.java
+2
-2
DependencyManagementBom.java
.../springframework/boot/groovy/DependencyManagementBom.java
+1
-0
FileSystemWatcher.java
...gframework/boot/devtools/filewatch/FileSystemWatcher.java
+4
-4
pom.xml
spring-boot-parent/pom.xml
+2
-2
checkstyle-suppressions.xml
...ng-boot-parent/src/checkstyle/checkstyle-suppressions.xml
+0
-18
checkstyle.xml
spring-boot-parent/src/checkstyle/checkstyle.xml
+3
-1
OverrideAutoConfiguration.java
...rk/boot/test/autoconfigure/OverrideAutoConfiguration.java
+1
-0
AnnotationCustomizableTypeExcludeFilter.java
...igure/filter/AnnotationCustomizableTypeExcludeFilter.java
+3
-1
TypeExcludeFilters.java
...rk/boot/test/autoconfigure/filter/TypeExcludeFilters.java
+1
-0
AutoConfigureJsonTesters.java
...oot/test/autoconfigure/json/AutoConfigureJsonTesters.java
+1
-0
JsonTest.java
...pringframework/boot/test/autoconfigure/json/JsonTest.java
+4
-0
AutoConfigureTestDatabase.java
...test/autoconfigure/orm/jpa/AutoConfigureTestDatabase.java
+3
-1
DataJpaTest.java
...ramework/boot/test/autoconfigure/orm/jpa/DataJpaTest.java
+4
-0
PropertyMapping.java
...k/boot/test/autoconfigure/properties/PropertyMapping.java
+2
-0
AutoConfigureMockMvc.java
.../test/autoconfigure/web/servlet/AutoConfigureMockMvc.java
+4
-0
WebMvcTest.java
...ework/boot/test/autoconfigure/web/servlet/WebMvcTest.java
+5
-0
SpringApplicationTest.java
...ingframework/boot/test/context/SpringApplicationTest.java
+1
-0
TestComponent.java
.../org/springframework/boot/test/context/TestComponent.java
+1
-0
TestConfiguration.java
.../springframework/boot/test/context/TestConfiguration.java
+1
-0
MockBean.java
.../org/springframework/boot/test/mock/mockito/MockBean.java
+7
-0
MockBeans.java
...org/springframework/boot/test/mock/mockito/MockBeans.java
+1
-0
RepackageTask.java
.../springframework/boot/gradle/repackage/RepackageTask.java
+15
-14
JsonComponent.java
.../java/org/springframework/boot/jackson/JsonComponent.java
+1
-0
No files found.
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jdbc/DataSourceAutoConfigurationTests.java
View file @
893a6c32
...
@@ -134,8 +134,8 @@ public class DataSourceAutoConfigurationTests {
...
@@ -134,8 +134,8 @@ public class DataSourceAutoConfigurationTests {
public
void
hikariValidatesConnectionByDefault
()
throws
Exception
{
public
void
hikariValidatesConnectionByDefault
()
throws
Exception
{
HikariDataSource
dataSource
=
autoConfigureDataSource
(
HikariDataSource
.
class
,
HikariDataSource
dataSource
=
autoConfigureDataSource
(
HikariDataSource
.
class
,
"org.apache.tomcat"
);
"org.apache.tomcat"
);
assertThat
(
dataSource
.
getConnectionTestQuery
()).
isNull
();
// Use
assertThat
(
dataSource
.
getConnectionTestQuery
()).
isNull
();
//
Connection#isValid()
// Use
Connection#isValid()
}
}
@Test
@Test
...
...
spring-boot-cli/src/main/java/org/springframework/boot/groovy/DependencyManagementBom.java
View file @
893a6c32
...
@@ -37,6 +37,7 @@ public @interface DependencyManagementBom {
...
@@ -37,6 +37,7 @@ public @interface DependencyManagementBom {
* One or more sets of colon-separated coordinates ({@code group:module:version}) of a
* One or more sets of colon-separated coordinates ({@code group:module:version}) of a
* Maven bom that contains dependency management that will add to and override the
* Maven bom that contains dependency management that will add to and override the
* default dependency management.
* default dependency management.
* @return the BOM coordinates
*/
*/
String
[]
value
();
String
[]
value
();
...
...
spring-boot-devtools/src/main/java/org/springframework/boot/devtools/filewatch/FileSystemWatcher.java
View file @
893a6c32
...
@@ -141,10 +141,10 @@ public class FileSystemWatcher {
...
@@ -141,10 +141,10 @@ public class FileSystemWatcher {
this
.
watchThread
=
new
Thread
()
{
this
.
watchThread
=
new
Thread
()
{
@Override
@Override
public
void
run
()
{
public
void
run
()
{
int
remaining
Scans
=
FileSystemWatcher
.
this
.
remainingScans
.
get
();
int
remaining
=
FileSystemWatcher
.
this
.
remainingScans
.
get
();
while
(
remaining
Scans
>
0
||
remainingScans
==
-
1
)
{
while
(
remaining
>
0
||
remaining
==
-
1
)
{
try
{
try
{
if
(
remaining
Scans
>
0
)
{
if
(
remaining
>
0
)
{
FileSystemWatcher
.
this
.
remainingScans
.
decrementAndGet
();
FileSystemWatcher
.
this
.
remainingScans
.
decrementAndGet
();
}
}
scan
();
scan
();
...
@@ -152,7 +152,7 @@ public class FileSystemWatcher {
...
@@ -152,7 +152,7 @@ public class FileSystemWatcher {
catch
(
InterruptedException
ex
)
{
catch
(
InterruptedException
ex
)
{
// Ignore
// Ignore
}
}
remaining
Scans
=
FileSystemWatcher
.
this
.
remainingScans
.
get
();
remaining
=
FileSystemWatcher
.
this
.
remainingScans
.
get
();
}
}
};
};
};
};
...
...
spring-boot-parent/pom.xml
View file @
893a6c32
...
@@ -244,12 +244,12 @@
...
@@ -244,12 +244,12 @@
<plugin>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-checkstyle-plugin
</artifactId>
<artifactId>
maven-checkstyle-plugin
</artifactId>
<version>
2.1
6
</version>
<version>
2.1
7
</version>
<dependencies>
<dependencies>
<dependency>
<dependency>
<groupId>
com.puppycrawl.tools
</groupId>
<groupId>
com.puppycrawl.tools
</groupId>
<artifactId>
checkstyle
</artifactId>
<artifactId>
checkstyle
</artifactId>
<version>
6.1
0.1
</version>
<version>
6.1
7
</version>
</dependency>
</dependency>
</dependencies>
</dependencies>
</plugin>
</plugin>
...
...
spring-boot-parent/src/checkstyle/checkstyle-suppressions.xml
View file @
893a6c32
...
@@ -20,22 +20,4 @@
...
@@ -20,22 +20,4 @@
<suppress
files=
"Ansi.*\.java"
checks=
"JavadocStyle"
/>
<suppress
files=
"Ansi.*\.java"
checks=
"JavadocStyle"
/>
<suppress
files=
"LogLevel\.java"
checks=
"JavadocVariable"
/>
<suppress
files=
"LogLevel\.java"
checks=
"JavadocVariable"
/>
<suppress
files=
"HelpMojo\.java"
checks=
".*"
/>
<suppress
files=
"HelpMojo\.java"
checks=
".*"
/>
<!-- https://github.com/checkstyle/checkstyle/issues/2141 -->
<suppress
files=
"ConfigurationProperties.java"
checks=
"JavadocMethod"
/>
<suppress
files=
"DeprecatedConfigurationProperty\.java"
checks=
"JavadocMethod"
/>
<suppress
files=
"EnableConfigurationProperties\.java"
checks=
"JavadocMethod"
/>
<suppress
files=
"EntityScan\.java"
checks=
"JavadocMethod"
/>
<suppress
files=
"SpringApplication\.java"
checks=
"JavadocMethod"
/>
<suppress
files=
"IntegrationTest\.java"
checks=
"JavadocMethod"
/>
<suppress
files=
"SpringApplicationConfiguration\.java"
checks=
"JavadocMethod"
/>
<suppress
files=
"WebIntegrationTest\.java"
checks=
"JavadocMethod"
/>
<suppress
files=
"ServletComponentScan\.java"
checks=
"JavadocMethod"
/>
<suppress
files=
"AutoConfigureAfter\.java"
checks=
"JavadocMethod"
/>
<suppress
files=
"AutoConfigureBefore\.java"
checks=
"JavadocMethod"
/>
<suppress
files=
"ConditionalOn.*\.java"
checks=
"JavadocMethod"
/>
<suppress
files=
"AutoConfigureOrder.java"
checks=
"JavadocMethod"
/>
<suppress
files=
"EnableAutoConfiguration.java"
checks=
"JavadocMethod"
/>
<suppress
files=
"SpringBootApplication.java"
checks=
"JavadocMethod"
/>
<suppress
files=
"ImportAutoConfiguration.java"
checks=
"JavadocMethod"
/>
</suppressions>
</suppressions>
spring-boot-parent/src/checkstyle/checkstyle.xml
View file @
893a6c32
...
@@ -114,7 +114,9 @@
...
@@ -114,7 +114,9 @@
</module>
</module>
<!-- Miscellaneous -->
<!-- Miscellaneous -->
<module
name=
"CommentsIndentation"
/>
<module
name=
"CommentsIndentation"
>
<property
name=
"tokens"
value=
"BLOCK_COMMENT_BEGIN"
/>
</module>
<module
name=
"UpperEll"
/>
<module
name=
"UpperEll"
/>
<module
name=
"ArrayTypeStyle"
/>
<module
name=
"ArrayTypeStyle"
/>
<module
name=
"OuterTypeFilename"
/>
<module
name=
"OuterTypeFilename"
/>
...
...
spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/OverrideAutoConfiguration.java
View file @
893a6c32
...
@@ -43,6 +43,7 @@ public @interface OverrideAutoConfiguration {
...
@@ -43,6 +43,7 @@ public @interface OverrideAutoConfiguration {
/**
/**
* The value of the {@link EnableAutoConfiguration#ENABLED_OVERRIDE_PROPERTY enabled
* The value of the {@link EnableAutoConfiguration#ENABLED_OVERRIDE_PROPERTY enabled
* property override}.
* property override}.
* @return the override value
*/
*/
boolean
enabled
();
boolean
enabled
();
...
...
spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/filter/AnnotationCustomizableTypeExcludeFilter.java
View file @
893a6c32
...
@@ -103,8 +103,10 @@ public abstract class AnnotationCustomizableTypeExcludeFilter extends TypeExclud
...
@@ -103,8 +103,10 @@ public abstract class AnnotationCustomizableTypeExcludeFilter extends TypeExclud
protected
abstract
Set
<
Class
<?>>
getDefaultIncludes
();
protected
abstract
Set
<
Class
<?>>
getDefaultIncludes
();
protected
static
enum
FilterType
{
protected
enum
FilterType
{
INCLUDE
,
EXCLUDE
INCLUDE
,
EXCLUDE
};
};
}
}
spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/filter/TypeExcludeFilters.java
View file @
893a6c32
...
@@ -45,6 +45,7 @@ public @interface TypeExcludeFilters {
...
@@ -45,6 +45,7 @@ public @interface TypeExcludeFilters {
* specified here can either have a no-arg constructor or accept a single
* specified here can either have a no-arg constructor or accept a single
* {@code Class<?>} argument if then need access to the {@code testClass}.
* {@code Class<?>} argument if then need access to the {@code testClass}.
* @see TypeExcludeFilter
* @see TypeExcludeFilter
* @return the type exclude filters to apply
*/
*/
Class
<?
extends
TypeExcludeFilter
>[]
value
();
Class
<?
extends
TypeExcludeFilter
>[]
value
();
...
...
spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/json/AutoConfigureJsonTesters.java
View file @
893a6c32
...
@@ -52,6 +52,7 @@ public @interface AutoConfigureJsonTesters {
...
@@ -52,6 +52,7 @@ public @interface AutoConfigureJsonTesters {
/**
/**
* If {@link BasicJsonTester}, {@link JacksonTester} and {@link GsonTester} fields
* If {@link BasicJsonTester}, {@link JacksonTester} and {@link GsonTester} fields
* should be initialized using marshallers from the {@link ApplicationContext}.
* should be initialized using marshallers from the {@link ApplicationContext}.
* @return if JSON tester fields should be initialized
*/
*/
boolean
initFields
()
default
true
;
boolean
initFields
()
default
true
;
...
...
spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/json/JsonTest.java
View file @
893a6c32
...
@@ -47,18 +47,22 @@ public @interface JsonTest {
...
@@ -47,18 +47,22 @@ public @interface JsonTest {
* {@code @JsonComponent} and {@code Module} beans are included.
* {@code @JsonComponent} and {@code Module} beans are included.
* @see #includeFilters()
* @see #includeFilters()
* @see #excludeFilters()
* @see #excludeFilters()
* @return if default filters should be used
*/
*/
boolean
useDefaultFilters
()
default
true
;
boolean
useDefaultFilters
()
default
true
;
/**
/**
* A set of include filters which can be used to add otherwise filtered beans to the
* A set of include filters which can be used to add otherwise filtered beans to the
* application context.
* application context.
* @return include filters to apply
*/
*/
Filter
[]
includeFilters
()
default
{};
Filter
[]
includeFilters
()
default
{};
/**
/**
* A set of exclude filters which can be used to filter beans that would otherwise be
* A set of exclude filters which can be used to filter beans that would otherwise be
* added to the application context.
* added to the application context.
* @return exclude filters to apply
*/
*/
Filter
[]
excludeFilters
()
default
{};
Filter
[]
excludeFilters
()
default
{};
}
}
spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/orm/jpa/AutoConfigureTestDatabase.java
View file @
893a6c32
...
@@ -43,13 +43,15 @@ import org.springframework.boot.test.autoconfigure.properties.PropertyMapping;
...
@@ -43,13 +43,15 @@ import org.springframework.boot.test.autoconfigure.properties.PropertyMapping;
public
@interface
AutoConfigureTestDatabase
{
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
;
Replace
replace
()
default
Replace
.
ANY
;
/**
/**
* The type of connection to be establish when {@link #replace() replacing} the data
* 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.
* 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
;
EmbeddedDatabaseConnection
connection
()
default
EmbeddedDatabaseConnection
.
NONE
;
...
...
spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/orm/jpa/DataJpaTest.java
View file @
893a6c32
...
@@ -69,6 +69,7 @@ public @interface DataJpaTest {
...
@@ -69,6 +69,7 @@ public @interface DataJpaTest {
/**
/**
* If SQL output should be logged.
* If SQL output should be logged.
* @return if SQL is logged
*/
*/
@PropertyMapping
(
"spring.jpa.show-sql"
)
@PropertyMapping
(
"spring.jpa.show-sql"
)
boolean
showSql
()
default
true
;
boolean
showSql
()
default
true
;
...
@@ -79,18 +80,21 @@ public @interface DataJpaTest {
...
@@ -79,18 +80,21 @@ public @interface DataJpaTest {
* included.
* included.
* @see #includeFilters()
* @see #includeFilters()
* @see #excludeFilters()
* @see #excludeFilters()
* @return if default filters should be used
*/
*/
boolean
useDefaultFilters
()
default
true
;
boolean
useDefaultFilters
()
default
true
;
/**
/**
* A set of include filters which can be used to add otherwise filtered beans to the
* A set of include filters which can be used to add otherwise filtered beans to the
* application context.
* application context.
* @return include filters to apply
*/
*/
Filter
[]
includeFilters
()
default
{};
Filter
[]
includeFilters
()
default
{};
/**
/**
* A set of exclude filters which can be used to filter beans that would otherwise be
* A set of exclude filters which can be used to filter beans that would otherwise be
* added to the application context.
* added to the application context.
* @return exclude filters to apply
*/
*/
Filter
[]
excludeFilters
()
default
{};
Filter
[]
excludeFilters
()
default
{};
...
...
spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/properties/PropertyMapping.java
View file @
893a6c32
...
@@ -58,6 +58,7 @@ public @interface PropertyMapping {
...
@@ -58,6 +58,7 @@ public @interface PropertyMapping {
* Defines the property mapping. When used at the type-level, this value will be used
* 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
* as a prefix for all mapped attributes. When used on an attribute, the value
* overrides the generated (kebab case) name.
* overrides the generated (kebab case) name.
* @return the property mapping
*/
*/
String
value
()
default
""
;
String
value
()
default
""
;
...
@@ -65,6 +66,7 @@ public @interface PropertyMapping {
...
@@ -65,6 +66,7 @@ public @interface PropertyMapping {
* Determines if mapping should occur. When specified at the type-level indicates if
* 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
* mapping should occur by default or not. When used at the attribute-level, overrides
* the type-level default.
* the type-level default.
* @return if mapping should occur
*/
*/
boolean
map
()
default
true
;
boolean
map
()
default
true
;
...
...
spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/AutoConfigureMockMvc.java
View file @
893a6c32
...
@@ -51,18 +51,21 @@ public @interface AutoConfigureMockMvc {
...
@@ -51,18 +51,21 @@ public @interface AutoConfigureMockMvc {
/**
/**
* If filters from the application context should be registered with MockMVC. Defaults
* If filters from the application context should be registered with MockMVC. Defaults
* to {@code true}.
* to {@code true}.
* @return if filters should be added
*/
*/
boolean
addFilters
()
default
true
;
boolean
addFilters
()
default
true
;
/**
/**
* If {@link MvcResult} information should always be printed after each MockMVC
* If {@link MvcResult} information should always be printed after each MockMVC
* invocation. Defaults to {@code true}.
* invocation. Defaults to {@code true}.
* @return if result information is always printed
*/
*/
boolean
alwaysPrint
()
default
true
;
boolean
alwaysPrint
()
default
true
;
/**
/**
* If a {@link WebClient} should be auto-configured when HtmlUnit is on the classpath.
* If a {@link WebClient} should be auto-configured when HtmlUnit is on the classpath.
* Defaults to {@code true}.
* Defaults to {@code true}.
* @return if a {@link WebClient} is auto-configured
*/
*/
@PropertyMapping
(
"webclient.enabled"
)
@PropertyMapping
(
"webclient.enabled"
)
boolean
webClientEnabled
()
default
true
;
boolean
webClientEnabled
()
default
true
;
...
@@ -70,6 +73,7 @@ public @interface AutoConfigureMockMvc {
...
@@ -70,6 +73,7 @@ public @interface AutoConfigureMockMvc {
/**
/**
* If a {@link WebDriver} should be auto-configured when Selenium is on the classpath.
* If a {@link WebDriver} should be auto-configured when Selenium is on the classpath.
* Defaults to {@code true}.
* Defaults to {@code true}.
* @return if a {@link WebDriver} is auto-configured
*/
*/
@PropertyMapping
(
"webdriver.enabled"
)
@PropertyMapping
(
"webdriver.enabled"
)
boolean
webDriverEnabled
()
default
true
;
boolean
webDriverEnabled
()
default
true
;
...
...
spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/WebMvcTest.java
View file @
893a6c32
...
@@ -78,6 +78,7 @@ public @interface WebMvcTest {
...
@@ -78,6 +78,7 @@ public @interface WebMvcTest {
* can be used for brevity if no other attributes are defined. See
* can be used for brevity if no other attributes are defined. See
* {@link #controllers()} for details.
* {@link #controllers()} for details.
* @see #controllers()
* @see #controllers()
* @return the controllers to test
*/
*/
@AliasFor
(
"controllers"
)
@AliasFor
(
"controllers"
)
Class
<?>[]
value
()
default
{};
Class
<?>[]
value
()
default
{};
...
@@ -86,6 +87,7 @@ public @interface WebMvcTest {
...
@@ -86,6 +87,7 @@ public @interface WebMvcTest {
* Specifies the controllers to test. May be left blank if all {@code @Controller}
* Specifies the controllers to test. May be left blank if all {@code @Controller}
* beans should be added to the application context.
* beans should be added to the application context.
* @see #value()
* @see #value()
* @return the controllers to test
*/
*/
@AliasFor
(
"value"
)
@AliasFor
(
"value"
)
Class
<?>[]
controllers
()
default
{};
Class
<?>[]
controllers
()
default
{};
...
@@ -98,18 +100,21 @@ public @interface WebMvcTest {
...
@@ -98,18 +100,21 @@ public @interface WebMvcTest {
* included.
* included.
* @see #includeFilters()
* @see #includeFilters()
* @see #excludeFilters()
* @see #excludeFilters()
* @return if default filters should be used
*/
*/
boolean
useDefaultFilters
()
default
true
;
boolean
useDefaultFilters
()
default
true
;
/**
/**
* A set of include filters which can be used to add otherwise filtered beans to the
* A set of include filters which can be used to add otherwise filtered beans to the
* application context.
* application context.
* @return include filters to apply
*/
*/
Filter
[]
includeFilters
()
default
{};
Filter
[]
includeFilters
()
default
{};
/**
/**
* A set of exclude filters which can be used to filter beans that would otherwise be
* A set of exclude filters which can be used to filter beans that would otherwise be
* added to the application context.
* added to the application context.
* @return exclude filters to apply
*/
*/
Filter
[]
excludeFilters
()
default
{};
Filter
[]
excludeFilters
()
default
{};
...
...
spring-boot-test/src/main/java/org/springframework/boot/test/context/SpringApplicationTest.java
View file @
893a6c32
...
@@ -61,6 +61,7 @@ public @interface SpringApplicationTest {
...
@@ -61,6 +61,7 @@ public @interface SpringApplicationTest {
/**
/**
* Properties in form {@literal key=value} that should be added to the Spring
* Properties in form {@literal key=value} that should be added to the Spring
* {@link Environment} before the test runs.
* {@link Environment} before the test runs.
* @return the properties to add
*/
*/
String
[]
value
()
default
{};
String
[]
value
()
default
{};
...
...
spring-boot-test/src/main/java/org/springframework/boot/test/context/TestComponent.java
View file @
893a6c32
...
@@ -48,6 +48,7 @@ public @interface TestComponent {
...
@@ -48,6 +48,7 @@ public @interface TestComponent {
/**
/**
* The value may indicate a suggestion for a logical component name, to be turned into
* 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.
* a Spring bean in case of an auto-detected component.
* @return the specified bean name, if any
*/
*/
String
value
()
default
""
;
String
value
()
default
""
;
...
...
spring-boot-test/src/main/java/org/springframework/boot/test/context/TestConfiguration.java
View file @
893a6c32
...
@@ -45,6 +45,7 @@ public @interface TestConfiguration {
...
@@ -45,6 +45,7 @@ public @interface TestConfiguration {
/**
/**
* Explicitly specify the name of the Spring bean definition associated with this
* Explicitly specify the name of the Spring bean definition associated with this
* Configuration class. See {@link Configuration#value()} for details.
* Configuration class. See {@link Configuration#value()} for details.
* @return the specified bean name, if any
*/
*/
String
value
()
default
""
;
String
value
()
default
""
;
...
...
spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/MockBean.java
View file @
893a6c32
...
@@ -85,12 +85,14 @@ public @interface MockBean {
...
@@ -85,12 +85,14 @@ public @interface MockBean {
* The name of the bean that should be registered with the application context. If not
* 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
* specified the name will either be generated or, if the mock replaces an existing
* bean, the existing name will be used.
* bean, the existing name will be used.
* @return the name of the bean
*/
*/
String
name
()
default
""
;
String
name
()
default
""
;
/**
/**
* The classes to mock. This is an alias of {@link #classes()} which can be used for
* 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.
* brevity if no other attributes are defined. See {@link #classes()} for details.
* @return the classes to mock
*/
*/
@AliasFor
(
"classes"
)
@AliasFor
(
"classes"
)
Class
<?>[]
value
()
default
{};
Class
<?>[]
value
()
default
{};
...
@@ -105,6 +107,7 @@ public @interface MockBean {
...
@@ -105,6 +107,7 @@ public @interface MockBean {
* <p>
* <p>
* If this is the only attribute specified consider using the {@code value} alias
* If this is the only attribute specified consider using the {@code value} alias
* instead.
* instead.
* @return the classes to mock
*/
*/
@AliasFor
(
"value"
)
@AliasFor
(
"value"
)
Class
<?>[]
classes
()
default
{};
Class
<?>[]
classes
()
default
{};
...
@@ -112,23 +115,27 @@ public @interface MockBean {
...
@@ -112,23 +115,27 @@ public @interface MockBean {
/**
/**
* Any extra interfaces that should also be declared on the mock. See
* Any extra interfaces that should also be declared on the mock. See
* {@link MockSettings#extraInterfaces(Class...)} for details.
* {@link MockSettings#extraInterfaces(Class...)} for details.
* @return any extra interfaces
*/
*/
Class
<?>[]
extraInterfaces
()
default
{};
Class
<?>[]
extraInterfaces
()
default
{};
/**
/**
* The {@link Answers} type to use on the mock.
* The {@link Answers} type to use on the mock.
* @return the answer type
*/
*/
Answers
answer
()
default
Answers
.
RETURNS_DEFAULTS
;
Answers
answer
()
default
Answers
.
RETURNS_DEFAULTS
;
/**
/**
* If the generated mock is serializable. See {@link MockSettings#serializable()} for
* If the generated mock is serializable. See {@link MockSettings#serializable()} for
* details.
* details.
* @return if the mock is serializable
*/
*/
boolean
serializable
()
default
false
;
boolean
serializable
()
default
false
;
/**
/**
* The reset mode to apply to the mock bean. The default is {@link MockReset#AFTER}
* 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.
* meaning that mocks are automatically reset after each test method is invoked.
* @return the reset mode
*/
*/
MockReset
reset
()
default
MockReset
.
AFTER
;
MockReset
reset
()
default
MockReset
.
AFTER
;
...
...
spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/MockBeans.java
View file @
893a6c32
...
@@ -40,6 +40,7 @@ public @interface MockBeans {
...
@@ -40,6 +40,7 @@ public @interface MockBeans {
/**
/**
* Return the contained {@link MockBean} annotations.
* Return the contained {@link MockBean} annotations.
* @return the mock beans
*/
*/
MockBean
[]
value
();
MockBean
[]
value
();
...
...
spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/repackage/RepackageTask.java
View file @
893a6c32
...
@@ -240,30 +240,31 @@ public class RepackageTask extends DefaultTask {
...
@@ -240,30 +240,31 @@ public class RepackageTask extends DefaultTask {
}
}
private
void
setMainClass
(
Repackager
repackager
)
{
private
void
setMainClass
(
Repackager
repackager
)
{
String
mainClass
;
String
mainClassName
=
getMainClassNameProperty
();
if
(
getProject
().
hasProperty
(
"mainClassName"
))
{
mainClass
=
(
String
)
getProject
().
property
(
"mainClassName"
);
}
else
{
ExtraPropertiesExtension
extraProperties
=
(
ExtraPropertiesExtension
)
getProject
()
.
getExtensions
().
getByName
(
"ext"
);
mainClass
=
(
String
)
extraProperties
.
get
(
"mainClassName"
);
}
if
(
RepackageTask
.
this
.
mainClass
!=
null
)
{
if
(
RepackageTask
.
this
.
mainClass
!=
null
)
{
mainClass
=
RepackageTask
.
this
.
mainClass
;
mainClass
Name
=
RepackageTask
.
this
.
mainClass
;
}
}
else
if
(
this
.
extension
.
getMainClass
()
!=
null
)
{
else
if
(
this
.
extension
.
getMainClass
()
!=
null
)
{
mainClass
=
this
.
extension
.
getMainClass
();
mainClass
Name
=
this
.
extension
.
getMainClass
();
}
}
else
{
else
{
Task
runTask
=
getProject
().
getTasks
().
findByName
(
"run"
);
Task
runTask
=
getProject
().
getTasks
().
findByName
(
"run"
);
if
(
runTask
!=
null
&&
runTask
.
hasProperty
(
"main"
))
{
if
(
runTask
!=
null
&&
runTask
.
hasProperty
(
"main"
))
{
mainClass
=
(
String
)
getProject
().
getTasks
().
getByName
(
"run"
)
mainClass
Name
=
(
String
)
getProject
().
getTasks
().
getByName
(
"run"
)
.
property
(
"main"
);
.
property
(
"main"
);
}
}
}
}
getLogger
().
info
(
"Setting mainClass: "
+
mainClass
);
getLogger
().
info
(
"Setting mainClass: "
+
mainClassName
);
repackager
.
setMainClass
(
mainClass
);
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
{
private
LaunchScript
getLaunchScript
()
throws
IOException
{
...
...
spring-boot/src/main/java/org/springframework/boot/jackson/JsonComponent.java
View file @
893a6c32
...
@@ -65,6 +65,7 @@ public @interface JsonComponent {
...
@@ -65,6 +65,7 @@ public @interface JsonComponent {
/**
/**
* The value may indicate a suggestion for a logical component name, to be turned into
* The value may indicate a suggestion for a logical component name, to be turned into
* a Spring bean in case of an autodetected component.
* a Spring bean in case of an autodetected component.
* @return the component name
*/
*/
String
value
()
default
""
;
String
value
()
default
""
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment