saravanakumar1987 commented on code in PR #31084:
URL: https://github.com/apache/camel/pull/31084#discussion_r4729716437
##########
components/camel-cxf/camel-cxf-rest/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpointTest.java:
##########
@@ -120,6 +123,44 @@ public void testCxfRsEndpointSetProvider() throws
Exception {
}
}
+ @Test
+ public void testCxfRsEndpointProvidersBeanIds() throws Exception {
+ JSONProvider<?> jsonProvider = new JSONProvider<>();
+ JAXBElementProvider<?> xmlProvider = new JAXBElementProvider<>();
+ context.getRegistry().bind("jsonProvider", jsonProvider);
+ context.getRegistry().bind("xmlProvider", xmlProvider);
+
+ String endpointUri = "cxfrs://http://localhost:" + CTX + ""
+ +
"?resourceClass=org.apache.camel.component.cxf.jaxrs.testbean.CustomerService"
+ + "&providers=#jsonProvider,#xmlProvider";
+
+ // as in a route, the context creates the endpoint with the generated
configurer and starts it
+ CxfRsEndpoint endpoint = context.getEndpoint(endpointUri,
CxfRsEndpoint.class);
+ JAXRSServerFactoryBean sfb = endpoint.createJAXRSServerFactoryBean();
+ assertEquals(List.of(jsonProvider, xmlProvider), sfb.getProviders(),
"Get wrong providers");
+ JAXRSClientFactoryBean cfb = endpoint.createJAXRSClientFactoryBean();
+ assertEquals(List.of(jsonProvider, xmlProvider), cfb.getProviders(),
"Get wrong providers");
+ }
+
+ @Test
+ public void testCxfRsEndpointProvidersListBean() throws Exception {
+ JSONProvider<?> jsonProvider = new JSONProvider<>();
+ JAXBElementProvider<?> xmlProvider = new JAXBElementProvider<>();
+ context.getRegistry().bind("myProviders", List.of(jsonProvider,
xmlProvider));
+
+ String endpointUri = "cxfrs://http://localhost:" + CTX + ""
+ +
"?resourceClass=org.apache.camel.component.cxf.jaxrs.testbean.CustomerService"
+ + "&providers=#myProviders";
Review Comment:
Fixed in 1f2f5f602b: the same change in
`testCxfRsEndpointProvidersListBean`. The older tests of the class keep their
form.
_Claude Code on behalf of saravanakumar1987_
--
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]