Merge branch '3.0.x'

Closes gh-35589
This commit is contained in:
Stephane Nicoll 2023-05-22 16:24:56 +02:00
commit 7a9bb55fdf
7 changed files with 13 additions and 14 deletions

View File

@ -58,7 +58,7 @@ class EclipseConventions {
}
private boolean isKotlinPluginContributedBuildDirectory(String path) {
return path.contains("/main") && path.contains("/build/classes/") || path.contains("/build/resources/");
return path.contains("/main") && (path.contains("/build/classes/") || path.contains("/build/resources/"));
}
private boolean isTest(Library library) {

View File

@ -175,13 +175,13 @@ public class ReactiveCloudFoundryActuatorAutoConfiguration {
@Override
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
if (bean instanceof WebFilterChainProxy webFilterChainProxy) {
return postProcess(webFilterChainProxy, this.pathMappedEndpoints.get());
return postProcess(webFilterChainProxy);
}
return bean;
}
private WebFilterChainProxy postProcess(WebFilterChainProxy existing, PathMappedEndpoints pathMappedEndpoints) {
List<String> paths = getPaths(pathMappedEndpoints);
private WebFilterChainProxy postProcess(WebFilterChainProxy existing) {
List<String> paths = getPaths(this.pathMappedEndpoints.get());
ServerWebExchangeMatcher cloudFoundryRequestMatcher = ServerWebExchangeMatchers
.pathMatchers(paths.toArray(new String[] {}));
WebFilter noOpFilter = (exchange, chain) -> chain.filter(exchange);

View File

@ -205,10 +205,9 @@ class ReactiveCloudFoundryActuatorAutoConfigurationTests {
}
private static Boolean getMatches(List<SecurityWebFilterChain> filters, String urlTemplate) {
Boolean cfBaseRequestMatches = filters.get(0)
return filters.get(0)
.matches(MockServerWebExchange.from(MockServerHttpRequest.get(urlTemplate).build()))
.block(Duration.ofSeconds(30));
return cfBaseRequestMatches;
}
@Test

View File

@ -69,6 +69,8 @@ class CloudFoundryActuatorAutoConfigurationTests {
private static final String V3_JSON = ApiVersion.V3.getProducedMimeType().toString();
private static final String BASE_PATH = "/cloudfoundryapplication";
private final WebApplicationContextRunner contextRunner = new WebApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(SecurityAutoConfiguration.class, WebMvcAutoConfiguration.class,
JacksonAutoConfiguration.class, DispatcherServletAutoConfiguration.class,
@ -77,8 +79,6 @@ class CloudFoundryActuatorAutoConfigurationTests {
ServletManagementContextAutoConfiguration.class, EndpointAutoConfiguration.class,
WebEndpointAutoConfiguration.class, CloudFoundryActuatorAutoConfiguration.class));
private static String BASE_PATH = "/cloudfoundryapplication";
@Test
void cloudFoundryPlatformActive() {
this.contextRunner
@ -189,9 +189,9 @@ class CloudFoundryActuatorAutoConfigurationTests {
});
}
private static void testCloudFoundrySecurity(MockHttpServletRequest request, String basePath,
private static void testCloudFoundrySecurity(MockHttpServletRequest request, String servletPath,
SecurityFilterChain chain) {
request.setServletPath(basePath);
request.setServletPath(servletPath);
assertThat(chain.matches(request)).isTrue();
}

View File

@ -23,7 +23,7 @@ import org.springframework.core.convert.support.ConfigurableConversionService;
* Callback interface that can be implemented by beans wishing to customize the
* {@link ConfigurableConversionService} that is
* {@link DefaultBatchConfiguration#getConversionService provided by
* DefaultBatchAutoConfiguration} while retaining its default auto-configuration.
* DefaultBatchConfiguration} while retaining its default auto-configuration.
*
* @author Claudio Nave
* @since 3.1.0

View File

@ -48,7 +48,7 @@ When doing so, the connection details take precedence over any connection-relate
When using Spring Boots Docker Compose support, service connections are established to the port mapped by the container.
NOTE: Docker compose is usually used in such a way that the ports inside the container are mapped to ephemeral ports on your computer.
For example, A Postgres server my run inside the container using port 5432 but be mapped to a totally different port locally.
For example, A Postgres server may run inside the container using port 5432 but be mapped to a totally different port locally.
The service connection will always discover and use the locally mapped port.
Service connections are established by using the image name of the container.
@ -154,7 +154,7 @@ The recommended way of checking for readiness is to add a `healthcheck` section
Since it's not uncommon for `healthcheck` configuration to be omitted from `compose.yml` files, Spring Boot also checks directly for service readiness.
By default, a container is considered ready when a TCP/IP connection can be established to its mapped port.
You can disable this on a per-container basis by add a `org.springframework.boot.readiness-check.tcp.disable` label in your `compose.yml` file.
You can disable this on a per-container basis by adding a `org.springframework.boot.readiness-check.tcp.disable` label in your `compose.yml` file.
For example:

View File

@ -19,10 +19,10 @@ org.springframework.boot.testcontainers.service.connection.liquibase.LiquibaseCo
org.springframework.boot.testcontainers.service.connection.mongo.MongoContainerConnectionDetailsFactory,\
org.springframework.boot.testcontainers.service.connection.neo4j.Neo4jContainerConnectionDetailsFactory,\
org.springframework.boot.testcontainers.service.connection.r2dbc.MariaDbR2dbcContainerConnectionDetailsFactory,\
org.springframework.boot.testcontainers.service.connection.r2dbc.SqlServerR2dbcContainerConnectionDetailsFactory,\
org.springframework.boot.testcontainers.service.connection.r2dbc.MySqlR2dbcContainerConnectionDetailsFactory,\
org.springframework.boot.testcontainers.service.connection.r2dbc.OracleR2dbcContainerConnectionDetailsFactory,\
org.springframework.boot.testcontainers.service.connection.r2dbc.PostgresR2dbcContainerConnectionDetailsFactory,\
org.springframework.boot.testcontainers.service.connection.r2dbc.SqlServerR2dbcContainerConnectionDetailsFactory,\
org.springframework.boot.testcontainers.service.connection.redis.RedisContainerConnectionDetailsFactory,\
org.springframework.boot.testcontainers.service.connection.redpanda.RedpandaContainerConnectionDetailsFactory,\
org.springframework.boot.testcontainers.service.connection.zipkin.ZipkinContainerConnectionDetailsFactory