Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id A8932200D2D for ; Fri, 27 Oct 2017 21:14:16 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id A6F34160BF2; Fri, 27 Oct 2017 19:14:16 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id C3CCC1609DD for ; Fri, 27 Oct 2017 21:14:15 +0200 (CEST) Received: (qmail 73053 invoked by uid 500); 27 Oct 2017 19:14: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 73041 invoked by uid 99); 27 Oct 2017 19:14:09 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 27 Oct 2017 19:14:09 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id AE0C21A039C for ; Fri, 27 Oct 2017 19:14:08 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.802 X-Spam-Level: X-Spam-Status: No, score=-0.802 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-2.8, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (1024-bit key) header.d=talend365.onmicrosoft.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id hoXYHJfHQBfd for ; Fri, 27 Oct 2017 19:14:06 +0000 (UTC) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0123.outbound.protection.outlook.com [104.47.36.123]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 1F9695F5B8 for ; Fri, 27 Oct 2017 19:14:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=talend365.onmicrosoft.com; s=selector1-talend-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=hOrENVVxRz3XtZCwmk5ImbFPTnqKfE3Y7MBzkB3RWT4=; b=d0Jtf/KuzujMtmiQZ4qG76TLLqCyxi1bnj4IJTuHXWFwWErjTciPRpx8D6rbdORbthXCpggiSzOV1fHo5+b7WTlPTOMV5OS0oD2QrUnjWaA80NCnmUCmKwcE95Mm7NNiMk0UD8p0acdq70cbphHwQN4HwUhhkFcBPmCp8G1Mw00= Received: from BN1PR12MB0051.namprd12.prod.outlook.com (10.160.81.153) by BN1PR12MB0052.namprd12.prod.outlook.com (10.160.81.154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.156.4; Fri, 27 Oct 2017 19:13:55 +0000 Received: from BN1PR12MB0051.namprd12.prod.outlook.com ([fe80::524:aa32:5903:32bb]) by BN1PR12MB0051.namprd12.prod.outlook.com ([fe80::524:aa32:5903:32bb%13]) with mapi id 15.20.0178.009; Fri, 27 Oct 2017 19:13:55 +0000 From: Oliver Wulff To: "users@camel.apache.org" Subject: AW: Sprint Unit test fails when OnCompletion configured Thread-Topic: Sprint Unit test fails when OnCompletion configured Thread-Index: AQHTTy0vQtxkuVrgqUy9uxx2gcJ8+aL3x8eAgAAJubeAAAEwaIAAAcUAgAA4BWo= Date: Fri, 27 Oct 2017 19:13:54 +0000 Message-ID: References: , In-Reply-To: Accept-Language: de-CH, en-US Content-Language: de-CH X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=owulff@talend.com; x-originating-ip: [108.171.128.182] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BN1PR12MB0052;6:WanGA/sWLFrKWJz0VfIuSuauTUqxkgCWniRyvHgq0ZyyTH0yFWyiiBS3UcTFdNIQlHHNUE9muoazzzmg+l/Le8QpT6qbeGqfEeoIdR6aLMdAmOaaxuyS3jH2xGk/ZH3+e9Xh4EjTVqj/OJO1roYstlC9AZhRtCBFflUNmQc7D1JwIgYxPy+T+pz6Z6L0cwwPjdDAOtxb+Pbj2nomOErkAyyo+NkagUf5eMp61/k6DSOJWMswu06HNqbyEGmGfPpjpAgAOlO5OVuASVnJe6cN/rSVp572Q3CHDv3eXOlah+YgXYSQdz9j6ESZfG15mBx9GA626U1b+fcPfI8t1gwDjQ==;5:53McalOz/bXpUadq9Fnc8mE8b/hkR8Tv6hKee/Cw+5UTEHBKT3eU8OqtX8YrysPofyH0yqmcsMh2/MuiwkB1aU7WitReDq0/4qF0XpxxO0xpfNezAY5llV7tl0FcY5YUiiA0EpPvWiBES8XGD2NLJw==;24:3Pj39SAxDf9qKdvwLpFySvjKdhqA27aptZQj10Ve1MAp1TbPhVJ4OHqVZazJYkrZ//kOPHmiHzXzfrK43dvt3sL6BbcPf7zn3SIr1VCLMnk=;7:XrjLbmLfEYpSjwcSPD8A89Rrjouw2mU+MjtV2/gVTEVBPTe/fS3rna2sflBiE8UbEui5kOEEu0d5NnBJQ1KPwSxMelbabgWRY6m8lhuCUVGBXUT0MN9Vb/v01eB7KmQPMgTPMiqFC7sKLcJaaX1QGp1ZBWmKJZpF2gfpV8NnkKK0zuO01iuBRM5tb42EsVpWDv+UEpGUnUIOIQDFcbp56NoieRqX/aJ7OQzFSnAtwxg= x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-correlation-id: c629c454-0868-4eb5-761e-08d51d6ede0a x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(4534020)(4602075)(2017052603199);SRVR:BN1PR12MB0052; x-ms-traffictypediagnostic: BN1PR12MB0052: x-exchange-antispam-report-test: UriScan:(158342451672863)(150554046322364); x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(93006095)(93001095)(3231020)(100000703101)(100105400095)(3002001)(10201501046)(6041248)(20161123562025)(20161123564025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:BN1PR12MB0052;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:BN1PR12MB0052; x-forefront-prvs: 0473A03F3F x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6029001)(346002)(376002)(199003)(189002)(24454002)(53754006)(55016002)(9686003)(101416001)(236005)(102836003)(97736004)(6916009)(86362001)(53546010)(5250100002)(6306002)(2501003)(53936002)(606006)(25786009)(53386004)(99286003)(54896002)(478600001)(106356001)(7696004)(33656002)(5660300001)(6506006)(1730700003)(5640700003)(76176999)(81156014)(8936002)(105586002)(966005)(50986999)(81166006)(14454004)(3280700002)(54356999)(6436002)(3846002)(7736002)(2906002)(189998001)(316002)(8676002)(6116002)(66066001)(2900100001)(2351001)(68736007)(3660700001)(93886005)(74316002)(2950100002);DIR:OUT;SFP:1102;SCL:1;SRVR:BN1PR12MB0052;H:BN1PR12MB0051.namprd12.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; received-spf: None (protection.outlook.com: talend.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: multipart/alternative; boundary="_000_BN1PR12MB005143EC904E0A724529DF29A25A0BN1PR12MB0051namp_" MIME-Version: 1.0 X-OriginatorOrg: talend.com X-MS-Exchange-CrossTenant-Network-Message-Id: c629c454-0868-4eb5-761e-08d51d6ede0a X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Oct 2017 19:13:54.9128 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 0333ca35-3f21-4f69-abef-c46d541d019d X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN1PR12MB0052 archived-at: Fri, 27 Oct 2017 19:14:16 -0000 --_000_BN1PR12MB005143EC904E0A724529DF29A25A0BN1PR12MB0051namp_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I've added the following snippet to my test class but still face the same i= ssue @Override public boolean isUseAdviceWith() { return true; } BTW, I extend the class org.apache.camel.test.spring.CamelSpringTestSupport= . I've found the documentation in the last section here: http://camel.apache.org/advicewith.html The mentioned example is slightly different because the Java DSL is used an= d not Spring DSL so the starting of the route is controlled by CamelSpringT= estSupport after the advice with. Any ideas? ________________________________ Von: Claus Ibsen Gesendet: Freitag, 27. Oktober 2017 17:36:50 An: users@camel.apache.org Betreff: Re: Sprint Unit test fails when OnCompletion configured Make sure to configure your unit test that you are using advice with There is a alert box about this in the docs On Fri, Oct 27, 2017 at 5:31 PM, Oliver Wulff wrote: > It's failing with the same error in version 2.18.5, 2.19.3 and 2.20.0 as = well. > > ________________________________ > Von: Oliver Wulff > Gesendet: Freitag, 27. Oktober 2017 17:27:06 > An: users@camel.apache.org > Betreff: AW: Sprint Unit test fails when OnCompletion configured > > > Sorry for missing this important information. It's 2.17.6 > > ________________________________ > Von: Claus Ibsen > Gesendet: Freitag, 27. Oktober 2017 16:51:27 > An: users@camel.apache.org > Betreff: Re: Sprint Unit test fails when OnCompletion configured > > What version of CAmel do you use > > On Fri, Oct 27, 2017 at 4:12 PM, Oliver Wulff wrote: >> Hi all >> >> >> I've got a very simple route which reads from a file, does some processi= ng and then sends it by mail. I've also created a unit test based on CamelS= pringTestSupport where I mock the smtp endpoint and update the consuming en= dpoint: >> >> >> @Override >> protected void doPostSetup() throws Exception { >> >> >> context.getRouteDefinition(ROUTE_ID).adviceWith(context, = new AdviceWithRouteBuilder() { >> @Override >> public void configure() throws Exception { >> replaceFromWith("direct:teststart"); >> weaveAddFirst().convertBodyTo(String.class); >> weaveAddLast().log(LoggingLevel.DEBUG, "End: ${b= ody}"); >> >> } >> }); >> >> >> @Override >> public String isMockEndpointsAndSkip() { >> return "smtp*"; >> } >> >> >> >> This is the route: >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> When I run the maven project without it works but if I ac= tivate it fails with the following error: >> >> >> >> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 4.577 se= c <<< FAILURE! - in com.example.email.CamelRouteTest >> testSendingMail(com.example.email.CamelRouteTest) Time elapsed: 4.514 s= ec <<< ERROR! >> java.lang.IllegalArgumentException: There are no outputs which matches: = * in the route: Route(email-deliver)[[From[direct:teststart]] -> [onComplet= ion[[To[jms:topic:MON?disableReplyTo=3Dtrue]]], Unmarshal[org.apache.camel.= model.dataformat.JaxbDataFormat@7ea08277], process[ref:dummy], To[smtp://{{= smtp.hostname}}?contentType=3Dtext/html]]] >> at org.apache.camel.builder.AdviceWithTasks$3.task(AdviceWithTas= ks.java:305) >> at org.apache.camel.model.RouteDefinition.adviceWith(RouteDefini= tion.java:281) >> at com.example.email.CamelRouteTest.doPostSetup(CamelRouteTest.j= ava:37) >> >> >> Results : >> >> Tests in error: >> CamelRouteTest>CamelTestSupport.setUp:240->doPostSetup:37 =BB IllegalA= rgument Th... >> >> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0 >> >> >> >> I've searched in the internet for this error "There are no outputs which= matches: *" but haven't found anything which explains why I've discovered = this behaviour. >> >> >> What do I have to change to fix the unit test. >> >> >> Thanks for your feedback >> >> Oli >> >> > > > > -- > Claus Ibsen > ----------------- > http://davsclaus.com @davsclaus > Camel in Action 2: https://www.manning.com/ibsen2 -- Claus Ibsen ----------------- http://davsclaus.com @davsclaus Camel in Action 2: https://www.manning.com/ibsen2 --_000_BN1PR12MB005143EC904E0A724529DF29A25A0BN1PR12MB0051namp_--