Return-Path: X-Original-To: apmail-camel-users-archive@www.apache.org Delivered-To: apmail-camel-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7DD57186BA for ; Wed, 22 Jul 2015 10:06:59 +0000 (UTC) Received: (qmail 12525 invoked by uid 500); 22 Jul 2015 09:39:57 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 12479 invoked by uid 500); 22 Jul 2015 09:39:57 -0000 Mailing-List: contact users-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@camel.apache.org Delivered-To: mailing list users@camel.apache.org Delivered-To: moderator for users@camel.apache.org Received: (qmail 97498 invoked by uid 99); 22 Jul 2015 09:33:12 -0000 X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.765 X-Spam-Level: ** X-Spam-Status: No, score=2.765 tagged_above=-999 required=6.31 tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_ENVFROM_END_DIGIT=0.25, NML_ADSP_CUSTOM_MED=1.2, URIBL_BLOCKED=0.001, URI_HEX=1.313] autolearn=disabled Date: Wed, 22 Jul 2015 02:33:03 -0700 (MST) From: moorthy31 To: users@camel.apache.org Message-ID: <1437557583283-5769738.post@n5.nabble.com> Subject: Set referenced Bean as end point MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit As part of camel integration test, I am trying to set bean referenced in the route builder as end point where body and header message is used to process the data and insert into the database. I don't know how to set reference bean as end point in my test case This is my camel contest : The below is the test method in my test case @Test public void testAsyncEndpointOK() throws InterruptedException { CamelContext camelContext = null; MockEndpoint end = null; try { ApplicationContext context = createApplicationContext(); camelContext = (CamelContext) context.getBean("camel.main"); ProducerTemplate producer = camelContext.createProducerTemplate(); end = getMockEndpoint("mock:ABCBean.class"); String messageBody = readMessage(); Map map = new HashMap(); map.put("messageType", "MSG_TYPE"); map.put("table", "TABLE"); // producer.sendBody(messageBody); // producer.sendBody("mock:ProcessorBean.class", messageBody); producer.sendBodyAndHeaders(end, messageBody, map); } catch (CamelExecutionException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } System.out.println(camelContext.getEndpoints()); end.assertIsSatisfied(); } public class ABCBean { @Handler public void handler(@Body String body, @Header(Constants.TABLE_NAME) String tableName, @Header(Constants.APP_ID) String appId) throws ApplicationException { try { methdod A{} } I want my test control goes to ABC bean where the messages get inserted into the table. Currently test control is not going to bean end point. Could you please help me, how do I send the message and header info into the referenced Bean? -- View this message in context: http://camel.465427.n5.nabble.com/Set-referenced-Bean-as-end-point-tp5769738.html Sent from the Camel - Users mailing list archive at Nabble.com.