mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
Merge branch '2.1.x'
This commit is contained in:
commit
4c21dc1c31
20
pom.xml
20
pom.xml
@ -60,14 +60,28 @@
|
||||
<suppressionsLocation>src/checkstyle/checkstyle-suppressions.xml</suppressionsLocation>
|
||||
<includeTestSourceDirectory>true</includeTestSourceDirectory>
|
||||
<propertyExpansion>main.basedir=${main.basedir}</propertyExpansion>
|
||||
<sourceDirectories>./</sourceDirectories>
|
||||
<includes>**/*</includes>
|
||||
<excludes>.git/**/*,target/**/*</excludes>
|
||||
</configuration>
|
||||
<goals>
|
||||
<goal>check</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>nohttp-checkstyle-validation</id>
|
||||
<phase>validate</phase>
|
||||
<configuration>
|
||||
<skip>${disable.checks}</skip>
|
||||
<configLocation>src/checkstyle/nohttp-checkstyle.xml</configLocation>
|
||||
<suppressionsLocation>src/checkstyle/nohttp-checkstyle-suppressions.xml</suppressionsLocation>
|
||||
<propertyExpansion>main.basedir=${main.basedir}</propertyExpansion>
|
||||
<sourceDirectories>${basedir}</sourceDirectories>
|
||||
<includes>**/*</includes>
|
||||
<excludes>.git/**/*,target/**/,**/.flattened-pom.xml</excludes>
|
||||
</configuration>
|
||||
<goals>
|
||||
<goal>check</goal>
|
||||
</goals>
|
||||
<inherited>false</inherited>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
|
@ -39,7 +39,7 @@ import org.springframework.context.annotation.Import;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
||||
import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
|
||||
|
||||
/**
|
||||
* Tests for {@link ControllerEndpointDiscoverer}.
|
||||
@ -123,7 +123,7 @@ class ControllerEndpointDiscovererTests {
|
||||
@Test
|
||||
void getEndpointWhenEndpointHasOperationsShouldThrowException() {
|
||||
this.contextRunner.withUserConfiguration(TestControllerWithOperation.class)
|
||||
.run(assertDiscoverer((discoverer) -> assertThatExceptionOfType(IllegalStateException.class)
|
||||
.run(assertDiscoverer((discoverer) -> assertThatIllegalStateException()
|
||||
.isThrownBy(discoverer::getEndpoints)
|
||||
.withMessageContaining("ControllerEndpoints must not declare operations")));
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ import org.springframework.context.annotation.Import;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
||||
import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
|
||||
|
||||
/**
|
||||
* Tests for {@link ServletEndpointDiscoverer}.
|
||||
@ -106,7 +106,7 @@ class ServletEndpointDiscovererTests {
|
||||
@Test
|
||||
void getEndpointWhenEndpointHasOperationsShouldThrowException() {
|
||||
this.contextRunner.withUserConfiguration(TestServletEndpointWithOperation.class)
|
||||
.run(assertDiscoverer((discoverer) -> assertThatExceptionOfType(IllegalStateException.class)
|
||||
.run(assertDiscoverer((discoverer) -> assertThatIllegalStateException()
|
||||
.isThrownBy(discoverer::getEndpoints)
|
||||
.withMessageContaining("ServletEndpoints must not declare operations")));
|
||||
}
|
||||
@ -114,21 +114,21 @@ class ServletEndpointDiscovererTests {
|
||||
@Test
|
||||
void getEndpointWhenEndpointNotASupplierShouldThrowException() {
|
||||
this.contextRunner.withUserConfiguration(TestServletEndpointNotASupplier.class)
|
||||
.run(assertDiscoverer((discoverer) -> assertThatExceptionOfType(IllegalStateException.class)
|
||||
.run(assertDiscoverer((discoverer) -> assertThatIllegalStateException()
|
||||
.isThrownBy(discoverer::getEndpoints).withMessageContaining("must be a supplier")));
|
||||
}
|
||||
|
||||
@Test
|
||||
void getEndpointWhenEndpointSuppliesWrongTypeShouldThrowException() {
|
||||
this.contextRunner.withUserConfiguration(TestServletEndpointSupplierOfWrongType.class)
|
||||
.run(assertDiscoverer((discoverer) -> assertThatExceptionOfType(IllegalStateException.class)
|
||||
.run(assertDiscoverer((discoverer) -> assertThatIllegalStateException()
|
||||
.isThrownBy(discoverer::getEndpoints).withMessageContaining("must supply an EndpointServlet")));
|
||||
}
|
||||
|
||||
@Test
|
||||
void getEndpointWhenEndpointSuppliesNullShouldThrowException() {
|
||||
this.contextRunner.withUserConfiguration(TestServletEndpointSupplierOfNull.class)
|
||||
.run(assertDiscoverer((discoverer) -> assertThatExceptionOfType(IllegalStateException.class)
|
||||
.run(assertDiscoverer((discoverer) -> assertThatIllegalStateException()
|
||||
.isThrownBy(discoverer::getEndpoints).withMessageContaining("must not supply null")));
|
||||
}
|
||||
|
||||
|
@ -3,14 +3,6 @@
|
||||
"-//Checkstyle//DTD SuppressionFilter Configuration 1.2//EN"
|
||||
"https://checkstyle.org/dtds/suppressions_1_2.dtd">
|
||||
<suppressions>
|
||||
<suppress files="\.DS_Store" checks=".*" />
|
||||
<suppress files="[\\/]spring-boot-gradle-plugin[\\/]build" checks=".*" />
|
||||
<suppress files="[\\/]\.flattened-pom\.xml" checks=".*" />
|
||||
<suppress files="[\\/]transaction-logs[\\/]" checks=".*" />
|
||||
<suppress files="[\\/]target[\\/]" checks=".*" />
|
||||
<suppress files="[\\/]build.log" checks=".*" />
|
||||
<suppress files=".+\.(jar|git|ico|p12|svg|png)" checks=".*" />
|
||||
<suppress files="eclipse[\\/]spring-boot-project.setup" checks="NoHttp"/>
|
||||
<suppress files="SpringApplicationTests\.java" checks="FinalClass" />
|
||||
<suppress files=".+Configuration\.java" checks="HideUtilityClassConstructor" />
|
||||
<suppress files=".+Application\.java" checks="HideUtilityClassConstructor" />
|
||||
|
14
src/checkstyle/nohttp-checkstyle-suppressions.xml
Normal file
14
src/checkstyle/nohttp-checkstyle-suppressions.xml
Normal file
@ -0,0 +1,14 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE suppressions PUBLIC
|
||||
"-//Checkstyle//DTD SuppressionFilter Configuration 1.2//EN"
|
||||
"https://checkstyle.org/dtds/suppressions_1_2.dtd">
|
||||
<suppressions>
|
||||
<suppress files="[\\/]transaction-logs[\\/]" checks="NoHttp" />
|
||||
<suppress files="[\\/]target[\\/]" checks="NoHttp" />
|
||||
<suppress files="[\\/]build.log" checks="NoHttp" />
|
||||
<suppress files=".+\.(jar|git|ico|p12|gif|jks|jpg)" checks="NoHttp" />
|
||||
<suppress files="dependency-reduced-pom.xml" checks="NoHttp" />
|
||||
<suppress files="jquery.validate.js" checks="NoHttp" />
|
||||
<suppress files="jquery-[0-9]\.[0-9]\.[0-9].js" checks="NoHttp" />
|
||||
<suppress files="[\\/]spring-boot-project.setup" checks="NoHttp" />
|
||||
</suppressions>
|
7
src/checkstyle/nohttp-checkstyle.xml
Normal file
7
src/checkstyle/nohttp-checkstyle.xml
Normal file
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.2//EN" "https://checkstyle.org/dtds/configuration_1_2.dtd">
|
||||
<module name="com.puppycrawl.tools.checkstyle.Checker">
|
||||
<module name="io.spring.nohttp.checkstyle.check.NoHttpCheck">
|
||||
<property name="whitelistFileName" value="${main.basedir}/src/checkstyle/nohttp-whitelist.txt"/>
|
||||
</module>
|
||||
</module>
|
@ -1,2 +1,8 @@
|
||||
^http://livereload.com/protocols/official-7.*
|
||||
^http://docs.groovy-lang.org.*
|
||||
^http://exslt.org/common.*
|
||||
^http://groovy-lang.org.*
|
||||
^http://hsqldb.org.*
|
||||
^http://livereload.com/.*
|
||||
^http://www.jdotsoft.com.*
|
||||
^http://spockframework.org.*
|
||||
^http://ganglia.sourceforge.net.*
|
||||
|
Loading…
Reference in New Issue
Block a user