citrusframework / citrus-simulator

Standalone simulator for different messaging transports such as Http REST, SOAP WebService, JMS, RMI, mail messaging and more
Apache License 2.0
44 stars 45 forks source link

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

Closed tschlat closed 6 months ago

tschlat commented 6 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.