fixing NettyRoutingFilterIntegrationTests #3993
Open
+8
−6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix NettyRoutingFilter tests by migrating error message config to Spring Boot 4 key
While running the Spring Cloud Gateway server WebFlux tests on the current
Spring Boot 4 / Spring Cloud 2025 snapshot, I hit failures in
NettyRoutingFilterIntegrationTests.shouldApplyGlobalResponseTimeoutForInvalidRouteTimeoutValue().This test asserts that the error response body contains a top-level
message field with the timeout text:
However, after the upgrade, the legacy configuration key:
is no longer supported. Spring Boot now expects the new
spring.web.error.include-message property and ignores the old key,
emitting a migration warning. As a result, the default behavior is to
omit the message attribute from the error JSON, causing the JsonPath
assertion on
$.messageto fail even though the gateway behavior isotherwise correct.
This PR updates the test configuration to use the new property so that
the error message field is once again included in the response body
and the tests can validate the timeout message as intended.
Summary of changes
spring-cloud-gateway-server-webflux/src/test/resources/application-netty-routing-filter.yml
spring-cloud-gateway-server-webflux/src/test/resources/application.yml:
Motivation
After the Spring Boot / Spring Cloud upgrade, the deprecated
server.error.include-message keyis no longer honored and triggers amigration warning. This silently changes the shape of the error JSON by
removing the message field, breaking tests that assert on that field.
Migrating the configuration to
spring.web.error.include-messagerestores the previous behavior (making the error message available to
clients and tests), keeps the tests stable across environments, and
removes the “configuration keys that are no longer supported” warnings
from the test logs.