citrusframework / citrus

Framework for automated integration tests with focus on messaging integration
https://citrusframework.org
Apache License 2.0
456 stars 134 forks source link

Proxied or subclassed Rest Scenarios cannot be mapped by HttpRequestAnnotationScenarioMapper #1103

Closed tschlat closed 7 months ago

tschlat commented 8 months ago

Citrus Version 4.X

Expected behavior In Citrus 4.X, we expect to have the ability to wrap Citrus Scenarios with a proxy, such as CGLIBProxy in the context of Spring AOP. This would allow us to configure aspects using pointcuts on Citrus scenarios. Additionally, scenarios wrapped in proxy classes should remain executable by Citrus.

Actual behavior However, in the case of Rest scenarios, there is an issue where execution fails. This failure occurs because the HttpRequestAnnotationScenarioMapper attempts to retrieve the @Scenario annotation directly from the scenario class to determine the scenario name. Proxy classes or other scenario subclasses may not provide this annotation directly, even though it exists in the hierarchy. This limitation prevents successful execution of Rest scenarios when wrapped in proxies or extended by subclasses.

tschlat commented 7 months ago

This is a citrus simulator issue and has been moved accordingly: https://github.com/citrusframework/citrus-simulator/issues/242