Skip to content

Commit 4c21dc1

Browse files
committed
Merge branch '2.1.x'
2 parents 56adc69 + fed11fe commit 4c21dc1

File tree

7 files changed

+51
-18
lines changed

7 files changed

+51
-18
lines changed

pom.xml

+16-2
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,27 @@
6060
<suppressionsLocation>src/checkstyle/checkstyle-suppressions.xml</suppressionsLocation>
6161
<includeTestSourceDirectory>true</includeTestSourceDirectory>
6262
<propertyExpansion>main.basedir=${main.basedir}</propertyExpansion>
63-
<sourceDirectories>./</sourceDirectories>
63+
</configuration>
64+
<goals>
65+
<goal>check</goal>
66+
</goals>
67+
</execution>
68+
<execution>
69+
<id>nohttp-checkstyle-validation</id>
70+
<phase>validate</phase>
71+
<configuration>
72+
<skip>${disable.checks}</skip>
73+
<configLocation>src/checkstyle/nohttp-checkstyle.xml</configLocation>
74+
<suppressionsLocation>src/checkstyle/nohttp-checkstyle-suppressions.xml</suppressionsLocation>
75+
<propertyExpansion>main.basedir=${main.basedir}</propertyExpansion>
76+
<sourceDirectories>${basedir}</sourceDirectories>
6477
<includes>**/*</includes>
65-
<excludes>.git/**/*,target/**/*</excludes>
78+
<excludes>.git/**/*,target/**/,**/.flattened-pom.xml</excludes>
6679
</configuration>
6780
<goals>
6881
<goal>check</goal>
6982
</goals>
83+
<inherited>false</inherited>
7084
</execution>
7185
</executions>
7286
</plugin>

spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/annotation/ControllerEndpointDiscovererTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
import org.springframework.validation.annotation.Validated;
4040

4141
import static org.assertj.core.api.Assertions.assertThat;
42-
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
42+
import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
4343

4444
/**
4545
* Tests for {@link ControllerEndpointDiscoverer}.
@@ -123,7 +123,7 @@ void getEndpointsShouldNotDiscoverRegularEndpoints() {
123123
@Test
124124
void getEndpointWhenEndpointHasOperationsShouldThrowException() {
125125
this.contextRunner.withUserConfiguration(TestControllerWithOperation.class)
126-
.run(assertDiscoverer((discoverer) -> assertThatExceptionOfType(IllegalStateException.class)
126+
.run(assertDiscoverer((discoverer) -> assertThatIllegalStateException()
127127
.isThrownBy(discoverer::getEndpoints)
128128
.withMessageContaining("ControllerEndpoints must not declare operations")));
129129
}

spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/annotation/ServletEndpointDiscovererTests.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
import org.springframework.validation.annotation.Validated;
4949

5050
import static org.assertj.core.api.Assertions.assertThat;
51-
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
51+
import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
5252

5353
/**
5454
* Tests for {@link ServletEndpointDiscoverer}.
@@ -106,29 +106,29 @@ void getEndpointsShouldNotDiscoverRegularEndpoints() {
106106
@Test
107107
void getEndpointWhenEndpointHasOperationsShouldThrowException() {
108108
this.contextRunner.withUserConfiguration(TestServletEndpointWithOperation.class)
109-
.run(assertDiscoverer((discoverer) -> assertThatExceptionOfType(IllegalStateException.class)
109+
.run(assertDiscoverer((discoverer) -> assertThatIllegalStateException()
110110
.isThrownBy(discoverer::getEndpoints)
111111
.withMessageContaining("ServletEndpoints must not declare operations")));
112112
}
113113

114114
@Test
115115
void getEndpointWhenEndpointNotASupplierShouldThrowException() {
116116
this.contextRunner.withUserConfiguration(TestServletEndpointNotASupplier.class)
117-
.run(assertDiscoverer((discoverer) -> assertThatExceptionOfType(IllegalStateException.class)
117+
.run(assertDiscoverer((discoverer) -> assertThatIllegalStateException()
118118
.isThrownBy(discoverer::getEndpoints).withMessageContaining("must be a supplier")));
119119
}
120120

121121
@Test
122122
void getEndpointWhenEndpointSuppliesWrongTypeShouldThrowException() {
123123
this.contextRunner.withUserConfiguration(TestServletEndpointSupplierOfWrongType.class)
124-
.run(assertDiscoverer((discoverer) -> assertThatExceptionOfType(IllegalStateException.class)
124+
.run(assertDiscoverer((discoverer) -> assertThatIllegalStateException()
125125
.isThrownBy(discoverer::getEndpoints).withMessageContaining("must supply an EndpointServlet")));
126126
}
127127

128128
@Test
129129
void getEndpointWhenEndpointSuppliesNullShouldThrowException() {
130130
this.contextRunner.withUserConfiguration(TestServletEndpointSupplierOfNull.class)
131-
.run(assertDiscoverer((discoverer) -> assertThatExceptionOfType(IllegalStateException.class)
131+
.run(assertDiscoverer((discoverer) -> assertThatIllegalStateException()
132132
.isThrownBy(discoverer::getEndpoints).withMessageContaining("must not supply null")));
133133
}
134134

src/checkstyle/checkstyle-suppressions.xml

-8
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,6 @@
33
"-//Checkstyle//DTD SuppressionFilter Configuration 1.2//EN"
44
"https://checkstyle.org/dtds/suppressions_1_2.dtd">
55
<suppressions>
6-
<suppress files="\.DS_Store" checks=".*" />
7-
<suppress files="[\\/]spring-boot-gradle-plugin[\\/]build" checks=".*" />
8-
<suppress files="[\\/]\.flattened-pom\.xml" checks=".*" />
9-
<suppress files="[\\/]transaction-logs[\\/]" checks=".*" />
10-
<suppress files="[\\/]target[\\/]" checks=".*" />
11-
<suppress files="[\\/]build.log" checks=".*" />
12-
<suppress files=".+\.(jar|git|ico|p12|svg|png)" checks=".*" />
13-
<suppress files="eclipse[\\/]spring-boot-project.setup" checks="NoHttp"/>
146
<suppress files="SpringApplicationTests\.java" checks="FinalClass" />
157
<suppress files=".+Configuration\.java" checks="HideUtilityClassConstructor" />
168
<suppress files=".+Application\.java" checks="HideUtilityClassConstructor" />
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0"?>
2+
<!DOCTYPE suppressions PUBLIC
3+
"-//Checkstyle//DTD SuppressionFilter Configuration 1.2//EN"
4+
"https://checkstyle.org/dtds/suppressions_1_2.dtd">
5+
<suppressions>
6+
<suppress files="[\\/]transaction-logs[\\/]" checks="NoHttp" />
7+
<suppress files="[\\/]target[\\/]" checks="NoHttp" />
8+
<suppress files="[\\/]build.log" checks="NoHttp" />
9+
<suppress files=".+\.(jar|git|ico|p12|gif|jks|jpg)" checks="NoHttp" />
10+
<suppress files="dependency-reduced-pom.xml" checks="NoHttp" />
11+
<suppress files="jquery.validate.js" checks="NoHttp" />
12+
<suppress files="jquery-[0-9]\.[0-9]\.[0-9].js" checks="NoHttp" />
13+
<suppress files="[\\/]spring-boot-project.setup" checks="NoHttp" />
14+
</suppressions>

src/checkstyle/nohttp-checkstyle.xml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0"?>
2+
<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.2//EN" "https://checkstyle.org/dtds/configuration_1_2.dtd">
3+
<module name="com.puppycrawl.tools.checkstyle.Checker">
4+
<module name="io.spring.nohttp.checkstyle.check.NoHttpCheck">
5+
<property name="whitelistFileName" value="${main.basedir}/src/checkstyle/nohttp-whitelist.txt"/>
6+
</module>
7+
</module>

src/checkstyle/nohttp-whitelist.txt

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,8 @@
1-
^http://livereload.com/protocols/official-7.*
1+
^http://docs.groovy-lang.org.*
22
^http://exslt.org/common.*
3+
^http://groovy-lang.org.*
4+
^http://hsqldb.org.*
5+
^http://livereload.com/.*
6+
^http://www.jdotsoft.com.*
7+
^http://spockframework.org.*
8+
^http://ganglia.sourceforge.net.*

0 commit comments

Comments
 (0)