Skip to content

WW-5535 test(core): cover wildcard-resolved unannotated methods via real proxy#1692

Merged
lukaszlenart merged 1 commit into
mainfrom
WW-5535-wildcard-integration-test
May 19, 2026
Merged

WW-5535 test(core): cover wildcard-resolved unannotated methods via real proxy#1692
lukaszlenart merged 1 commit into
mainfrom
WW-5535-wildcard-integration-test

Conversation

@lukaszlenart
Copy link
Copy Markdown
Member

@lukaszlenart lukaszlenart commented May 19, 2026

Summary

Closes the integration test gap identified in the WW-5535 research: no test exercised HttpMethodInterceptor against a real DefaultActionProxy resolving a wildcard action with an unannotated method.

Together with the existing MockActionProxy-based regression tests, this locks in both halves of the fix:

What the test does

Uses the existing xwork-test-allowed-methods.xml:

<action name="Wild-*" class="HttpMethodsTestAction" method="{1}">

HttpMethodsTestAction carries class-level @AllowedHttpMethod(POST). URL Wild-execute resolves to ActionSupport.execute() — no method-level HTTP annotation. The integration test:

  1. Creates a real proxy via actionProxyFactory.createActionProxy("", "Wild-execute", null, ...)
  2. Asserts proxy.getMethod() == "execute" and proxy.isMethodSpecified() == true (sanity-checks the WW-5535 wiring)
  3. Runs a real HttpMethodInterceptor against proxy.getInvocation() with a GET request
  4. Asserts bad-request — class-level annotation still enforced

Only the negative (GET) case is covered: it returns before invocation.invoke(), so the test stays a focused integration check without dragging the whole interceptor stack in. The positive POST counterpart is already covered by the unit tests added in #1690.

Fixes WW-5535 test gap.

Test plan

  • `mvn test -DskipAssembly -pl core -Dtest=HttpMethodInterceptorTest` — 16/16 pass
  • CI green

…eal proxy

Closes the test gap noted in the WW-5535 research: no integration test
exercised HttpMethodInterceptor against a real DefaultActionProxy resolving
a wildcard action with an unannotated method.

Uses xwork-test-allowed-methods.xml's existing <action name="Wild-*"
method="{1}"> on HttpMethodsTestAction. URL "Wild-execute" resolves to
ActionSupport.execute() (no method-level HTTP annotation); the class-level
@AllowedHttpMethod(POST) must still reject GET end-to-end.

Together with the prior MockActionProxy regression tests, this locks in
both halves of the fix:
- DefaultActionProxy.resolveMethod() sets isMethodSpecified()=true for
  wildcard-resolved methods (WW-5535 / #1592)
- HttpMethodInterceptor falls back to class-level annotations when the
  resolved method is unannotated (#1690)
@lukaszlenart lukaszlenart enabled auto-merge (squash) May 19, 2026 07:55
@lukaszlenart lukaszlenart merged commit 419fb1f into main May 19, 2026
7 checks passed
@lukaszlenart lukaszlenart deleted the WW-5535-wildcard-integration-test branch May 19, 2026 08:26
@sonarqubecloud
Copy link
Copy Markdown

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.

1 participant