Fix checkstyle violations

pull/17066/head
Phillip Webb 6 years ago
parent 4c21dc1c31
commit cde4f0d688

@ -122,9 +122,8 @@ class ControllerEndpointDiscovererTests {
@Test @Test
void getEndpointWhenEndpointHasOperationsShouldThrowException() { void getEndpointWhenEndpointHasOperationsShouldThrowException() {
this.contextRunner.withUserConfiguration(TestControllerWithOperation.class) this.contextRunner.withUserConfiguration(TestControllerWithOperation.class).run(
.run(assertDiscoverer((discoverer) -> assertThatIllegalStateException() assertDiscoverer((discoverer) -> assertThatIllegalStateException().isThrownBy(discoverer::getEndpoints)
.isThrownBy(discoverer::getEndpoints)
.withMessageContaining("ControllerEndpoints must not declare operations"))); .withMessageContaining("ControllerEndpoints must not declare operations")));
} }

@ -105,9 +105,8 @@ class ServletEndpointDiscovererTests {
@Test @Test
void getEndpointWhenEndpointHasOperationsShouldThrowException() { void getEndpointWhenEndpointHasOperationsShouldThrowException() {
this.contextRunner.withUserConfiguration(TestServletEndpointWithOperation.class) this.contextRunner.withUserConfiguration(TestServletEndpointWithOperation.class).run(
.run(assertDiscoverer((discoverer) -> assertThatIllegalStateException() assertDiscoverer((discoverer) -> assertThatIllegalStateException().isThrownBy(discoverer::getEndpoints)
.isThrownBy(discoverer::getEndpoints)
.withMessageContaining("ServletEndpoints must not declare operations"))); .withMessageContaining("ServletEndpoints must not declare operations")));
} }

@ -16,7 +16,6 @@
package org.springframework.boot.autoconfigure.packagestest.one; package org.springframework.boot.autoconfigure.packagestest.one;
import org.springframework.boot.autoconfigure.AutoConfigurationPackagesTests;
import org.springframework.boot.autoconfigure.AutoConfigurationPackagesTests.TestRegistrar; import org.springframework.boot.autoconfigure.AutoConfigurationPackagesTests.TestRegistrar;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Import;

@ -5,7 +5,7 @@
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * https://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
@ -75,15 +75,17 @@ class EmbeddedServerContainerInvocationContextProvider
EmbeddedServletContainerTest annotation = context.getRequiredTestClass() EmbeddedServletContainerTest annotation = context.getRequiredTestClass()
.getAnnotation(EmbeddedServletContainerTest.class); .getAnnotation(EmbeddedServletContainerTest.class);
return CONTAINERS.stream() return CONTAINERS.stream()
.map((container) -> new ApplicationBuilder(this.tempDir, annotation.packaging(), container)) .map((container) -> new ApplicationBuilder(this.tempDir, annotation.packaging(),
.flatMap((builder) -> { container))
return Stream.of(annotation.launchers()) .flatMap(
.map((launcherClass) -> ReflectionUtils.newInstance(launcherClass, builder, buildOutput)) (builder) -> Stream
.map((launcher) -> new EmbeddedServletContainerInvocationContext( .of(annotation.launchers()).map(
StringUtils.capitalize(builder.getContainer()) + ": " (launcherClass) -> ReflectionUtils.newInstance(launcherClass, builder,
+ launcher.getDescription(builder.getPackaging()), buildOutput))
launcher)); .map((launcher) -> new EmbeddedServletContainerInvocationContext(
}); StringUtils.capitalize(builder.getContainer()) + ": "
+ launcher.getDescription(builder.getPackaging()),
launcher)));
} }
@Override @Override
@ -135,7 +137,7 @@ class EmbeddedServerContainerInvocationContextProvider
} }
private static class RestTemplateParameterResolver implements ParameterResolver { private static final class RestTemplateParameterResolver implements ParameterResolver {
private final AbstractApplicationLauncher launcher; private final AbstractApplicationLauncher launcher;

@ -5,7 +5,7 @@
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * https://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
@ -16,19 +16,20 @@
package org.springframework.boot.context.embedded; package org.springframework.boot.context.embedded;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target; import java.lang.annotation.Target;
import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.api.extension.ExtendWith;
import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
/** /**
* @author awilkinson * Annotation used to configure servlet container tests.
*
* @author Andy Wilkinson
*/ */
@Retention(RUNTIME) @Retention(RetentionPolicy.RUNTIME)
@Target(TYPE) @Target(ElementType.TYPE)
@ExtendWith(EmbeddedServerContainerInvocationContextProvider.class) @ExtendWith(EmbeddedServerContainerInvocationContextProvider.class)
public @interface EmbeddedServletContainerTest { public @interface EmbeddedServletContainerTest {

@ -3,6 +3,7 @@
"-//Checkstyle//DTD SuppressionFilter Configuration 1.2//EN" "-//Checkstyle//DTD SuppressionFilter Configuration 1.2//EN"
"https://checkstyle.org/dtds/suppressions_1_2.dtd"> "https://checkstyle.org/dtds/suppressions_1_2.dtd">
<suppressions> <suppressions>
<suppress files="[\\/]src[\\/]test[\\/]" checks="RedundantModifier" />
<suppress files="SpringApplicationTests\.java" checks="FinalClass" /> <suppress files="SpringApplicationTests\.java" checks="FinalClass" />
<suppress files=".+Configuration\.java" checks="HideUtilityClassConstructor" /> <suppress files=".+Configuration\.java" checks="HideUtilityClassConstructor" />
<suppress files=".+Application\.java" checks="HideUtilityClassConstructor" /> <suppress files=".+Application\.java" checks="HideUtilityClassConstructor" />

@ -6,7 +6,7 @@
<suppress files="[\\/]transaction-logs[\\/]" checks="NoHttp" /> <suppress files="[\\/]transaction-logs[\\/]" checks="NoHttp" />
<suppress files="[\\/]target[\\/]" checks="NoHttp" /> <suppress files="[\\/]target[\\/]" checks="NoHttp" />
<suppress files="[\\/]build.log" checks="NoHttp" /> <suppress files="[\\/]build.log" checks="NoHttp" />
<suppress files=".+\.(jar|git|ico|p12|gif|jks|jpg)" checks="NoHttp" /> <suppress files=".+\.(jar|git|ico|p12|gif|jks|jpg|svg)" checks="NoHttp" />
<suppress files="dependency-reduced-pom.xml" checks="NoHttp" /> <suppress files="dependency-reduced-pom.xml" checks="NoHttp" />
<suppress files="jquery.validate.js" checks="NoHttp" /> <suppress files="jquery.validate.js" checks="NoHttp" />
<suppress files="jquery-[0-9]\.[0-9]\.[0-9].js" checks="NoHttp" /> <suppress files="jquery-[0-9]\.[0-9]\.[0-9].js" checks="NoHttp" />

Loading…
Cancel
Save