lukaszlenart opened a new pull request, #1692:
URL: https://github.com/apache/struts/pull/1692

   ## Summary
   
   Closes the integration test gap identified in the [WW-5535 
research](https://github.com/apache/struts/blob/main/thoughts/shared/research/2026-02-22-WW-5535-http-method-interceptor-wildcard.md):
 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:
   
   - `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
   
   ## What the test does
   
   Uses the existing `xwork-test-allowed-methods.xml`:
   
   ```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](https://issues.apache.org/jira/browse/WW-5535) test gap.
   
   ## Test plan
   
   - [x] \`mvn test -DskipAssembly -pl core -Dtest=HttpMethodInterceptorTest\` 
— 16/16 pass
   - [ ] CI green


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to