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 27DD11882B for ; Fri, 3 Jul 2015 08:27:10 +0000 (UTC) Received: (qmail 40208 invoked by uid 500); 3 Jul 2015 08:27:09 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 40166 invoked by uid 500); 3 Jul 2015 08:27:09 -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 Received: (qmail 40154 invoked by uid 99); 3 Jul 2015 08:27:09 -0000 Received: from Unknown (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Jul 2015 08:27:09 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 0E5B6D1DA0 for ; Fri, 3 Jul 2015 08:27:09 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 4.001 X-Spam-Level: **** X-Spam-Status: No, score=4.001 tagged_above=-999 required=6.31 tests=[HTML_MESSAGE=3, KAM_LAZY_DOMAIN_SECURITY=1, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id XBLvXbR4o7_3 for ; Fri, 3 Jul 2015 08:27:02 +0000 (UTC) Received: from relay.nhs.uk (relay.nhs.uk [62.208.144.128]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTPS id 83B3F2095C for ; Fri, 3 Jul 2015 08:27:01 +0000 (UTC) Received: from nhs-pd1e-esg110.ad1.nhs.net (nhs-pd1e-esg110.ad1.nhs.net [127.0.0.1]) by IMSVA80 (Postfix) with ESMTP id 54A4431B2E0 for ; Fri, 3 Jul 2015 09:26:52 +0100 (BST) Received: from smtp2.oxnet.nhs.uk (smtp2.oxnet.nhs.uk [10.134.250.206]) by nhs-pd1e-esg110.ad1.nhs.net (Postfix) with ESMTP id 346F0448265 for ; Fri, 3 Jul 2015 09:26:52 +0100 (BST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2CeBAC4RpZV/zGChgpbgkWBIV+/K4YAAoF/EAEBAQEBAQGBCoQqLV4BgQAmAQQb1jIBAQgCAR+QH4NPgRQFlBIBhGCJA5ZLhCFugksBAQE X-IPAS-Result: A2CeBAC4RpZV/zGChgpbgkWBIV+/K4YAAoF/EAEBAQEBAQGBCoQqLV4BgQAmAQQb1jIBAQgCAR+QH4NPgRQFlBIBhGCJA5ZLhCFugksBAQE X-IronPort-AV: E=Sophos;i="5.15,398,1432594800"; d="scan'208,217";a="343432" Received: from oxnetexht2.oxnet.nhs.uk ([10.134.130.49]) by smtp2.oxnet.nhs.uk with ESMTP; 03 Jul 2015 09:26:52 +0100 Received: from OXNETEXMB1.oxnet.nhs.uk ([10.134.130.46]) by OXNETEXHT2.oxnet.nhs.uk ([10.134.130.49]) with mapi; Fri, 3 Jul 2015 09:26:51 +0100 From: "Coombes Paul (RTH) OUH" To: "users@camel.apache.org" Date: Fri, 3 Jul 2015 09:26:50 +0100 Subject: Mocking Endpoints Query Thread-Topic: Mocking Endpoints Query Thread-Index: AdC1aV8SQReI2fhmSMG+1XHyFq9lZw== OLD-MSG-ID: <6869BCBA54CD3447A58ACA82FC4F1CF601E392AE131E@OXNETEXMB1.oxnet.nhs.uk> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: multipart/alternative; boundary="_000_6869BCBA54CD3447A58ACA82FC4F1CF601E392AE131EOXNETEXMB1o_" MIME-Version: 1.0 Message-Id: <20150703082652.346F0448265@nhs-pd1e-esg110.ad1.nhs.net> X-TM-AS-Product-Ver: IMSVA-8.0.0.1495-8.0.0.1202-21652.006 X-TM-AS-Result: No--23.716-60-31-10 X-imss-scan-details: No--23.716-60-31-10;No--23.716-3-31-10;No--23.716-4-31-10 X-TMASE-MatchedRID: vFJ/O3KOjNXPOb61tmLEGjXNObtCvUotQCq8Rr9ITAIjJTYshMkID36B zLuXQS0emInrZgN6ks9QtACpIb1B3hwT8eexWFrjdARARTk4h58k2ugFoZn4tYtoPF88Qg37wWF moDKYUNWYE5TOGnQ9OVdZT3gmUOlTpXzB0o5tjd4Cg1rav4R3DQeCHewokHM/Z5yuplze9psDta 2/qQ4uyIVB3qSMYJLYfOgEhVKUfEUZ7jQwc54lYrrbxxduc6FP31asM/gsp2nHtB+yzAhXFcEau LbH4aQcbgqpvRqEHYl/pbK05rJl29ZXwwpvfhGVvFkq3/rNercytf6nW43O0BS11FlOYRohXalr 5okxvJqcV82SZ+zUCLI2bT94ZMbKizFhECDuofD4pTO56aJ0/OrRJDUyDHkI6KREf4md4h9L/hr /YMmS/4b/AHX39OT61UjFGrktczaXBXaJoB9JZxRFJJyf5BJeyJ1gFgOMhOmz9acA5oLOm3kguu QorcgMyfVKPkAxr6dPtJvIgYB1ibaZJfKfZc9gZEcEZvy5aWB+3BndfXUhXQ== --_000_6869BCBA54CD3447A58ACA82FC4F1CF601E392AE131EOXNETEXMB1o_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Dear Camel Guru's I have a query regarding testing of a Java DSL route and how to effectively= mock endpoints. I have a SpringRouteBuilder (see following) that polls a database table via= the hibernate component, with the results being split into individual resu= lt items which are transformed into an HAPI HL7 Message via a custom proces= sor before being sent to a HL7 receiver via a Mina2 endpoint. Having looked over the testing documentation and not seeing an immediately = obvious answer, my question is, how best to test a routes logic whilst mock= ing the producer and consumer endpoints (Hibernate and Mina2 respectively) = without duplicating the route logic in a Junit test? HL7RouteBuilder from("hibernate:HibernateModel?consumeDelete=3Dfalse&consumer.query=3DFROM = HibernateModel WHERE processed =3D 'N'") .split(simple("body")) .log(LoggingLevel.DEBUG, "my.logger", "Transforming HibernateModel ${body.i= d}") .to("direct:toHL7"); from("direct:toHL7") .onException(new Class[] { java.lang.Exception.class }) .log(LoggingLevel.ERROR, " my.logger", "Failed to generate ORU^R01 ${body.i= d} - ${exception.stacktrace}") .stop() .end() .log(LoggingLevel.DEBUG, "my.logger", "Transforming HibernateModel ${body.i= d} into HLv2 ORU^R01") .processRef("modelProcessor") .marshal().hl7(false) .to("mirthV2StoreOut"); Camel Spring Configuration Kind Regards, Paul --_000_6869BCBA54CD3447A58ACA82FC4F1CF601E392AE131EOXNETEXMB1o_--