Saravanakumar Selvaraj created CAMEL-27446:
----------------------------------------------
Summary: camel-cxf: cxfrs providers - test the option in the
endpoint URI, and say that one List bean works too
Key: CAMEL-27446
URL: https://issues.apache.org/jira/browse/CAMEL-27446
Project: Camel
Issue Type: Improvement
Components: camel-cxf
Reporter: Saravanakumar Selvaraj
Follow-up of the review of https://github.com/apache/camel/pull/29725
(CAMEL-23832). That pull request removed a sentence about a List bean from the
description of the cxfrs providers option. The review left the List form to a
separate change.
How the option works on main at 387e1d7613:
- CxfRsEndpoint.doInit splits the value at the commas and looks up each bean
id. It adds each bean to the providers list with setProvider.
- setupCommonFactoryProperties passes that list to setProviders of the CXF
factory bean. It does so for the server of the consumer and for the client of
the producer.
- AbstractJAXRSFactoryBean.setProviders of CXF 4.2.4 calls
AbstractEndpointFactory.addToBeans. That method adds the elements of a
collection one by one.
So with providers=#myProviders, where myProviders is a List, the elements of
the List become the providers.
Two gaps:
- No test sets providers in the endpoint URI. CxfRsEndpointTest calls
setProvider, and the Spring tests set cxf:providers on the factory beans.
- The description names only the form with commas, #jsonProvider,#xmlProvider.
Proposed change:
- A test in CxfRsEndpointTest for both forms. It checks the providers of the
server factory bean and of the client factory bean.
- One sentence in the description that one List bean works too.
No behavior changes. Checked in the code of Camel and of CXF 4.2.4, not in a
run. The new test will show it.
_Claude Code on behalf of saravanakumar1987_
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)