Skip to content

test: move ComponentTests and add HeaderUtils tests (#1520) - #1522

Closed
dhionson2 wants to merge 1 commit into
spring-cloud:mainfrom
dhionson2:fix/issue-1520-clean
Closed

dhionson2 wants to merge 1 commit into
spring-cloud:mainfrom
dhionson2:fix/issue-1520-clean

Conversation

@dhionson2

Copy link
Copy Markdown
Contributor

Summary

This PR addresses #1520 by moving ComponentTests from src/main/resources to the appropriate test source directory and adding dedicated unit tests for HeaderUtils.

Changes

  • Move ComponentTests to src/test/java/org/springframework/cloud/function/scan/.
  • Add @AutoConfigureTestRestTemplate to support the existing integration tests with the current Spring Boot setup.
  • Add six JUnit 5 tests for HeaderUtils, covering:
    • Internal and custom header filtering.
    • Case handling for header names.
    • Message-to-HTTP header conversion.
    • HTTP header sanitization.
    • Single and multiple header values.
    • Content-Type normalization.

No production code or dependencies were changed.

Testing

Module build:

./mvnw -f spring-cloud-function-web/pom.xml package
  • BUILD SUCCESS
  • 207 tests reported, 0 failures, 0 errors, 25 skipped
  • Checkstyle passed
  • Verified test classes are excluded from the production JAR

Full reactor verification:

./mvnw -pl spring-cloud-function-web -am verify

The reactor verification could not complete on Windows because JsonMessageConverterAllowlistPackagingTests in spring-cloud-function-context encountered two teardown errors while deleting a temporary allowlist.jar locked by another process.

The assertions passed, but the temporary-file cleanup errors prevented the reactor from reaching the web module.

The standalone web module build and tests passed successfully.

Fixes #1520

Signed-off-by: Dhionson Plaster Moreira <89803431+dhionson2@users.noreply.github.com>
@dhionson2
dhionson2 force-pushed the fix/issue-1520-clean branch from 63dfff7 to 89d0c45 Compare November 19, 2026 00:26
olegz pushed a commit that referenced this pull request Nov 21, 2026
Resolves #1520
Resolves #1522

Signed-off-by: Dhionson Plaster Moreira <89803431+dhionson2@users.noreply.github.com>
Signed-off-by: Oleg Zhurakousky <oleg.zhurakousky@broadcom.com>
olegz added a commit that referenced this pull request Nov 21, 2026
… and WebFlux DELETE

Add tests for the start/stop lifecycle of SupplierExporter, for the HTTP
method eligibility checks of FunctionWebRequestProcessingHelper and for
HTTP DELETE of a consumer on WebFlux.

Resolves #1522

Signed-off-by: Oleg Zhurakousky <oleg.zhurakousky@broadcom.com>
@olegz olegz closed this in f7f0d7c Nov 21, 2026
zemiles pushed a commit to zemiles/spring-cloud-function that referenced this pull request Nov 24, 2026
… eligibility and WebFlux DELETE

Add tests for the start/stop lifecycle of SupplierExporter, for the HTTP
method eligibility checks of FunctionWebRequestProcessingHelper and for
HTTP DELETE of a consumer on WebFlux.

Resolves spring-cloud#1522

Signed-off-by: Oleg Zhurakousky <oleg.zhurakousky@broadcom.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move stray ComponentTests out of src/main/resources and add HeaderUtils tests

1 participant