Skip to content

Commit cde4f0d

Browse files
committed
Fix checkstyle violations
1 parent 4c21dc1 commit cde4f0d

File tree

7 files changed

+27
-26
lines changed

7 files changed

+27
-26
lines changed

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

+2-3
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,8 @@ void getEndpointsShouldNotDiscoverRegularEndpoints() {
122122

123123
@Test
124124
void getEndpointWhenEndpointHasOperationsShouldThrowException() {
125-
this.contextRunner.withUserConfiguration(TestControllerWithOperation.class)
126-
.run(assertDiscoverer((discoverer) -> assertThatIllegalStateException()
127-
.isThrownBy(discoverer::getEndpoints)
125+
this.contextRunner.withUserConfiguration(TestControllerWithOperation.class).run(
126+
assertDiscoverer((discoverer) -> assertThatIllegalStateException().isThrownBy(discoverer::getEndpoints)
128127
.withMessageContaining("ControllerEndpoints must not declare operations")));
129128
}
130129

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

+2-3
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,8 @@ void getEndpointsShouldNotDiscoverRegularEndpoints() {
105105

106106
@Test
107107
void getEndpointWhenEndpointHasOperationsShouldThrowException() {
108-
this.contextRunner.withUserConfiguration(TestServletEndpointWithOperation.class)
109-
.run(assertDiscoverer((discoverer) -> assertThatIllegalStateException()
110-
.isThrownBy(discoverer::getEndpoints)
108+
this.contextRunner.withUserConfiguration(TestServletEndpointWithOperation.class).run(
109+
assertDiscoverer((discoverer) -> assertThatIllegalStateException().isThrownBy(discoverer::getEndpoints)
111110
.withMessageContaining("ServletEndpoints must not declare operations")));
112111
}
113112

spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/packagestest/one/FirstConfiguration.java

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
package org.springframework.boot.autoconfigure.packagestest.one;
1818

19-
import org.springframework.boot.autoconfigure.AutoConfigurationPackagesTests;
2019
import org.springframework.boot.autoconfigure.AutoConfigurationPackagesTests.TestRegistrar;
2120
import org.springframework.context.annotation.Configuration;
2221
import org.springframework.context.annotation.Import;

spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/java/org/springframework/boot/context/embedded/EmbeddedServerContainerInvocationContextProvider.java

+13-11
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
77
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
8+
* https://www.apache.org/licenses/LICENSE-2.0
99
*
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -75,15 +75,17 @@ public Stream<TestTemplateInvocationContext> provideTestTemplateInvocationContex
7575
EmbeddedServletContainerTest annotation = context.getRequiredTestClass()
7676
.getAnnotation(EmbeddedServletContainerTest.class);
7777
return CONTAINERS.stream()
78-
.map((container) -> new ApplicationBuilder(this.tempDir, annotation.packaging(), container))
79-
.flatMap((builder) -> {
80-
return Stream.of(annotation.launchers())
81-
.map((launcherClass) -> ReflectionUtils.newInstance(launcherClass, builder, buildOutput))
82-
.map((launcher) -> new EmbeddedServletContainerInvocationContext(
83-
StringUtils.capitalize(builder.getContainer()) + ": "
84-
+ launcher.getDescription(builder.getPackaging()),
85-
launcher));
86-
});
78+
.map((container) -> new ApplicationBuilder(this.tempDir, annotation.packaging(),
79+
container))
80+
.flatMap(
81+
(builder) -> Stream
82+
.of(annotation.launchers()).map(
83+
(launcherClass) -> ReflectionUtils.newInstance(launcherClass, builder,
84+
buildOutput))
85+
.map((launcher) -> new EmbeddedServletContainerInvocationContext(
86+
StringUtils.capitalize(builder.getContainer()) + ": "
87+
+ launcher.getDescription(builder.getPackaging()),
88+
launcher)));
8789
}
8890

8991
@Override
@@ -135,7 +137,7 @@ public Object resolveParameter(ParameterContext parameterContext, ExtensionConte
135137

136138
}
137139

138-
private static class RestTemplateParameterResolver implements ParameterResolver {
140+
private static final class RestTemplateParameterResolver implements ParameterResolver {
139141

140142
private final AbstractApplicationLauncher launcher;
141143

spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/java/org/springframework/boot/context/embedded/EmbeddedServletContainerTest.java

+8-7
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
77
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
8+
* https://www.apache.org/licenses/LICENSE-2.0
99
*
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,19 +16,20 @@
1616

1717
package org.springframework.boot.context.embedded;
1818

19+
import java.lang.annotation.ElementType;
1920
import java.lang.annotation.Retention;
21+
import java.lang.annotation.RetentionPolicy;
2022
import java.lang.annotation.Target;
2123

2224
import org.junit.jupiter.api.extension.ExtendWith;
2325

24-
import static java.lang.annotation.ElementType.TYPE;
25-
import static java.lang.annotation.RetentionPolicy.RUNTIME;
26-
2726
/**
28-
* @author awilkinson
27+
* Annotation used to configure servlet container tests.
28+
*
29+
* @author Andy Wilkinson
2930
*/
30-
@Retention(RUNTIME)
31-
@Target(TYPE)
31+
@Retention(RetentionPolicy.RUNTIME)
32+
@Target(ElementType.TYPE)
3233
@ExtendWith(EmbeddedServerContainerInvocationContextProvider.class)
3334
public @interface EmbeddedServletContainerTest {
3435

src/checkstyle/checkstyle-suppressions.xml

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"-//Checkstyle//DTD SuppressionFilter Configuration 1.2//EN"
44
"https://checkstyle.org/dtds/suppressions_1_2.dtd">
55
<suppressions>
6+
<suppress files="[\\/]src[\\/]test[\\/]" checks="RedundantModifier" />
67
<suppress files="SpringApplicationTests\.java" checks="FinalClass" />
78
<suppress files=".+Configuration\.java" checks="HideUtilityClassConstructor" />
89
<suppress files=".+Application\.java" checks="HideUtilityClassConstructor" />

src/checkstyle/nohttp-checkstyle-suppressions.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<suppress files="[\\/]transaction-logs[\\/]" checks="NoHttp" />
77
<suppress files="[\\/]target[\\/]" checks="NoHttp" />
88
<suppress files="[\\/]build.log" checks="NoHttp" />
9-
<suppress files=".+\.(jar|git|ico|p12|gif|jks|jpg)" checks="NoHttp" />
9+
<suppress files=".+\.(jar|git|ico|p12|gif|jks|jpg|svg)" checks="NoHttp" />
1010
<suppress files="dependency-reduced-pom.xml" checks="NoHttp" />
1111
<suppress files="jquery.validate.js" checks="NoHttp" />
1212
<suppress files="jquery-[0-9]\.[0-9]\.[0-9].js" checks="NoHttp" />

0 commit comments

Comments
 (0)