@Test public void testFacebookComponent() throws Exception { FacebookComponent component = new FacebookComponent(); FacebookConfiguration configuration = component.getConfiguration(); String baseURL = "http://localhost:8080/camel-facebook-tests/fake-facebook-api"; configuration.setClientURL(baseURL); configuration.setOAuthAccessTokenURL(baseURL + "/oauth-token"); configuration.setRestBaseURL(baseURL + "/rest"); CamelContext camelctx = new DefaultCamelContext(); camelctx.addComponent("facebook", component); camelctx.addRoutes(new RouteBuilder() { @Override public void configure() throws Exception { from("direct:start") .toF("facebook://getTestUsers?oAuthAppId=%s&oAuthAppSecret=%s&appId=%s", FACEBOOK_APP_ID, FACEBOOK_APP_SECRET, FACEBOOK_APP_ID); } }); camelctx.start(); try { ProducerTemplate template = camelctx.createProducerTemplate(); PagableList testUserList = template.requestBody("direct:start", null, PagableList.class); Assert.assertNotNull("Facebook app test user list was null", testUserList); } finally { camelctx.stop(); } }
public FacebookComponent() { this(new FacebookConfiguration()); }
public FacebookComponent(FacebookConfiguration configuration) { this(null, configuration); }
public FacebookComponent(CamelContext context) { this(context, new FacebookConfiguration()); }
public FacebookComponent(CamelContext context, FacebookConfiguration configuration) { super(context, FacebookEndpoint.class); this.configuration = configuration; }
public FacebookConfiguration getConfiguration() { return configuration; }
/** * To use the shared configuration */ public void setConfiguration(FacebookConfiguration configuration) { this.configuration = configuration; }
public void setConfiguration(FacebookConfiguration configuration) { this.configuration = configuration; }
protected FacebookConfiguration getConfiguration() { return configuration; }