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 8FABA200BB2 for ; Sat, 29 Oct 2016 21:05:01 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 8E3C5160AF4; Sat, 29 Oct 2016 19:05:01 +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 D40AA160AE3 for ; Sat, 29 Oct 2016 21:05:00 +0200 (CEST) Received: (qmail 49845 invoked by uid 500); 29 Oct 2016 19:05:00 -0000 Mailing-List: contact issues-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list issues@camel.apache.org Received: (qmail 49832 invoked by uid 99); 29 Oct 2016 19:05:00 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 29 Oct 2016 19:05:00 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id B05552C014E for ; Sat, 29 Oct 2016 19:04:59 +0000 (UTC) Date: Sat, 29 Oct 2016 19:04:59 +0000 (UTC) From: "Claus Ibsen (JIRA)" To: issues@camel.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Assigned] (CAMEL-10412) Unable to exclude CamelAutoConfiguration in Spring Boot MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Sat, 29 Oct 2016 19:05:01 -0000 [ https://issues.apache.org/jira/browse/CAMEL-10412?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Claus Ibsen reassigned CAMEL-10412: ----------------------------------- Assignee: Claus Ibsen > Unable to exclude CamelAutoConfiguration in Spring Boot > ------------------------------------------------------- > > Key: CAMEL-10412 > URL: https://issues.apache.org/jira/browse/CAMEL-10412 > Project: Camel > Issue Type: Improvement > Components: camel-spring-boot > Affects Versions: 2.18.0 > Reporter: Minh Tran > Assignee: Claus Ibsen > Priority: Minor > Fix For: 2.19.0 > > > Prior to 2.18.0, you could exclude CamelAutoConfiguration in unit tests and no camel context would start up. This is useful for testing things in isolation that does not need camel and is a standard thing to do in Spring Boot since by default it auto configures everything it can find. > Now with 2.18.0, there has been a lot more auto configuration classes added and required to be excluded. Virtually every *AutoConfiguration class found in camel-core-starter needs to be excluded. This is not practical to do. > I have edited one file DirectComponentAutoConfiguration and added this line @ConditionalOnBean(CamelAutoConfiguration.class) > and with my unit test, I can see it no longer tries to pull in that component. > {noformat} > @RunWith(SpringJUnit4ClassRunner.class) > @SpringBootTest > public class PlainTest { > @Configuration > @EnableAutoConfiguration(exclude = { CamelAutoConfiguration.class > // , DirectComponentAutoConfiguration.class, DirectVmComponentAutoConfiguration.class, > // LogComponentAutoConfiguration.class, PropertiesComponentAutoConfiguration.class, RestComponentAutoConfiguration.class, > // SchedulerComponentAutoConfiguration.class, SedaComponentAutoConfiguration.class, StubComponentAutoConfiguration.class, > // ValidatorComponentAutoConfiguration.class, VmComponentAutoConfiguration.class, XsltComponentAutoConfiguration.class, > // GzipDataFormatAutoConfiguration.class, SerializationDataFormatAutoConfiguration.class, StringDataFormatAutoConfiguration.class, > // ZipDataFormatAutoConfiguration.class, BeanLanguageAutoConfiguration.class, ConstantLanguageAutoConfiguration.class, > // HeaderLanguageAutoConfiguration.class > // > }) > public static class Config { > } > @Test > public void test() { > // do something > } > } > {noformat} > Unfortunately I cannot put this into git and commit since I see at the top of the DirectComponentAutoConfiguration file > {noformat} > Generated by camel-package-maven-plugin - do not edit this file! > {noformat} > I'm not sure what to edit to get this to auto generate correctly with the changes required so I'll leave it to you guys. > Don't forget to update the camel-core-starter/pom.xml file and add the camel-spring-boot dependency in. -- This message was sent by Atlassian JIRA (v6.3.4#6332)