public class CxfRsSpringEndpointTest extends CamelSpringTestSupport {
@Test
public void testCreateCxfRsServerFactoryBean() {
CxfRsEndpoint endpoint = resolveMandatoryEndpoint("cxfrs://bean://rsServer", CxfRsEndpoint.class);
SpringJAXRSServerFactoryBean sfb = (SpringJAXRSServerFactoryBean)endpoint.createJAXRSServerFactoryBean();
assertEquals("Get a wrong provider size", 1, sfb.getProviders().size());
assertEquals("Get a wrong beanId", sfb.getBeanId(), "rsServer");
assertEquals("Get a wrong address", sfb.getAddress(), "http://localhost:9000/router");
assertEquals("Get a wrong size of resource classes", sfb.getResourceClasses().size(), 1);
assertEquals("Get a wrong resource class", sfb.getResourceClasses().get(0), CustomerService.class);
assertEquals("Got the wrong loggingFeatureEnabled", true, sfb.isLoggingFeatureEnabled());
assertEquals("Got the wrong loggingSizeLimit", 200, sfb.getLoggingSizeLimit());
assertEquals("Got a wrong size of interceptors", 1, sfb.getInInterceptors().size());
Map<String, Object> endpointProps = sfb.getProperties();
// The beanId key is put by the AbstractCxfBeanDefinitionParser, so the size is 2
assertEquals("Single endpoint property is expected", 2, endpointProps.size());
assertEquals("Wrong property value", "aValue", endpointProps.get("aKey"));
}