Reformat code following spring-javaformat upgrade

This commit is contained in:
Phillip Webb
2023-02-21 22:49:23 -08:00
parent b93c9f7fec
commit df5898a146
1878 changed files with 27649 additions and 22403 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2021 the original author or authors.
* Copyright 2012-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -80,18 +80,15 @@ class EmbeddedServerContainerInvocationContextProvider
@Override
public Stream<TestTemplateInvocationContext> provideTestTemplateInvocationContexts(ExtensionContext context) {
EmbeddedServletContainerTest annotation = context.getRequiredTestClass()
.getAnnotation(EmbeddedServletContainerTest.class);
return CONTAINERS
.stream().map(
(container) -> getApplication(annotation, container))
.flatMap(
(builder) -> Stream
.of(annotation.launchers()).map(
(launcherClass) -> getAbstractApplicationLauncher(builder, launcherClass))
.map((launcher) -> new EmbeddedServletContainerInvocationContext(
StringUtils.capitalize(builder.getContainer()) + ": "
+ launcher.getDescription(builder.getPackaging()),
launcher)));
.getAnnotation(EmbeddedServletContainerTest.class);
return CONTAINERS.stream()
.map((container) -> getApplication(annotation, container))
.flatMap((builder) -> Stream.of(annotation.launchers())
.map((launcherClass) -> getAbstractApplicationLauncher(builder, launcherClass))
.map((launcher) -> new EmbeddedServletContainerInvocationContext(
StringUtils.capitalize(builder.getContainer()) + ": "
+ launcher.getDescription(builder.getPackaging()),
launcher)));
}
@Override

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2021 the original author or authors.
* Copyright 2012-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -68,7 +68,7 @@ class EmbeddedServletContainerJarPackagingIntegrationTests {
@TestTemplate
void applicationClassesAreNotAvailableViaHttp(RestTemplate rest) {
ResponseEntity<String> entity = rest
.getForEntity("/BOOT-INF/classes/com/example/ResourceHandlingApplication.class", String.class);
.getForEntity("/BOOT-INF/classes/com/example/ResourceHandlingApplication.class", String.class);
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.NOT_FOUND);
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2021 the original author or authors.
* Copyright 2012-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -77,7 +77,7 @@ class EmbeddedServletContainerWarDevelopmentIntegrationTests {
ResponseEntity<String> entity = rest.getForEntity("/resourcePaths", String.class);
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
assertThat(readLines(entity.getBody()))
.noneMatch((resourcePath) -> resourcePath.startsWith("/org/springframework/boot/loader"));
.noneMatch((resourcePath) -> resourcePath.startsWith("/org/springframework/boot/loader"));
}
private List<String> readLines(String input) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2021 the original author or authors.
* Copyright 2012-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -75,7 +75,7 @@ class EmbeddedServletContainerWarPackagingIntegrationTests {
@TestTemplate
void applicationClassesAreNotAvailableViaHttp(RestTemplate rest) {
ResponseEntity<String> entity = rest
.getForEntity("/WEB-INF/classes/com/example/ResourceHandlingApplication.class", String.class);
.getForEntity("/WEB-INF/classes/com/example/ResourceHandlingApplication.class", String.class);
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.NOT_FOUND);
}
@@ -99,14 +99,14 @@ class EmbeddedServletContainerWarPackagingIntegrationTests {
ResponseEntity<String> entity = rest.getForEntity("/resourcePaths", String.class);
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
assertThat(readLines(entity.getBody()))
.noneMatch((resourcePath) -> resourcePath.startsWith("/org/springframework/boot/loader"));
.noneMatch((resourcePath) -> resourcePath.startsWith("/org/springframework/boot/loader"));
}
@TestTemplate
void conditionalOnWarDeploymentBeanIsNotAvailableForEmbeddedServer(RestTemplate rest) {
assertThat(rest.getForEntity("/always", String.class).getStatusCode()).isEqualTo(HttpStatus.OK);
assertThat(rest.getForEntity("/conditionalOnWar", String.class).getStatusCode())
.isEqualTo(HttpStatus.NOT_FOUND);
.isEqualTo(HttpStatus.NOT_FOUND);
}
private List<String> readLines(String input) {