[jira] [Commented] (CAMEL-12494) spring-boot: use ApplicationContextRunner in spring-boot test to test AutoConfigurations
[ https://issues.apache.org/jira/browse/CAMEL-12494?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16524729#comment-16524729 ] Luca Burgazzoli commented on CAMEL-12494: - Should be done by end of the day > spring-boot: use ApplicationContextRunner in spring-boot test to test > AutoConfigurations > > > Key: CAMEL-12494 > URL: https://issues.apache.org/jira/browse/CAMEL-12494 > Project: Camel > Issue Type: Task > Components: camel-spring-boot, camel-spring-boot-starters >Reporter: Luca Burgazzoli >Assignee: Luca Burgazzoli >Priority: Minor > Fix For: 2.22.0 > > > We should migrate AutoConfigurations related test to use > ApplicationContextRunner, see: > https://spring.io/blog/2018/03/07/testing-auto-configurations-with-spring-boot-2-0 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CAMEL-12494) spring-boot: use ApplicationContextRunner in spring-boot test to test AutoConfigurations
[ https://issues.apache.org/jira/browse/CAMEL-12494?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16524688#comment-16524688 ] Claus Ibsen commented on CAMEL-12494: - Whats the status of this? > spring-boot: use ApplicationContextRunner in spring-boot test to test > AutoConfigurations > > > Key: CAMEL-12494 > URL: https://issues.apache.org/jira/browse/CAMEL-12494 > Project: Camel > Issue Type: Task > Components: camel-spring-boot, camel-spring-boot-starters >Reporter: Luca Burgazzoli >Assignee: Luca Burgazzoli >Priority: Minor > Fix For: 2.22.0 > > > We should migrate AutoConfigurations related test to use > ApplicationContextRunner, see: > https://spring.io/blog/2018/03/07/testing-auto-configurations-with-spring-boot-2-0 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CAMEL-12494) spring-boot: use ApplicationContextRunner in spring-boot test to test AutoConfigurations
[ https://issues.apache.org/jira/browse/CAMEL-12494?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16503316#comment-16503316 ] Ramu kakarla commented on CAMEL-12494: --- I have checked again. I have checked other projects like 'camel-spring-cloud','camel-spring-cloud-consul' ... I don't find any. May be I am missing something here. > spring-boot: use ApplicationContextRunner in spring-boot test to test > AutoConfigurations > > > Key: CAMEL-12494 > URL: https://issues.apache.org/jira/browse/CAMEL-12494 > Project: Camel > Issue Type: Task > Components: camel-spring-boot, camel-spring-boot-starters >Reporter: Luca Burgazzoli >Priority: Minor > Fix For: 2.22.0 > > > We should migrate AutoConfigurations related test to use > ApplicationContextRunner, see: > https://spring.io/blog/2018/03/07/testing-auto-configurations-with-spring-boot-2-0 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CAMEL-12494) spring-boot: use ApplicationContextRunner in spring-boot test to test AutoConfigurations
[ https://issues.apache.org/jira/browse/CAMEL-12494?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16481635#comment-16481635 ] Luca Burgazzoli commented on CAMEL-12494: - [~kramu.k7] can you go ahead with the other tests doing the same ? > spring-boot: use ApplicationContextRunner in spring-boot test to test > AutoConfigurations > > > Key: CAMEL-12494 > URL: https://issues.apache.org/jira/browse/CAMEL-12494 > Project: Camel > Issue Type: Task > Components: camel-spring-boot, camel-spring-boot-starters >Reporter: Luca Burgazzoli >Priority: Minor > Fix For: 2.22.0 > > > We should migrate AutoConfigurations related test to use > ApplicationContextRunner, see: > https://spring.io/blog/2018/03/07/testing-auto-configurations-with-spring-boot-2-0 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CAMEL-12494) spring-boot: use ApplicationContextRunner in spring-boot test to test AutoConfigurations
[ https://issues.apache.org/jira/browse/CAMEL-12494?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16480417#comment-16480417 ] ASF GitHub Bot commented on CAMEL-12494: Github user oscerd closed the pull request at: https://github.com/apache/camel/pull/2343 > spring-boot: use ApplicationContextRunner in spring-boot test to test > AutoConfigurations > > > Key: CAMEL-12494 > URL: https://issues.apache.org/jira/browse/CAMEL-12494 > Project: Camel > Issue Type: Task > Components: camel-spring-boot, camel-spring-boot-starters >Reporter: Luca Burgazzoli >Assignee: Andrea Cosentino >Priority: Minor > Fix For: 2.22.0 > > > We should migrate AutoConfigurations related test to use > ApplicationContextRunner, see: > https://spring.io/blog/2018/03/07/testing-auto-configurations-with-spring-boot-2-0 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CAMEL-12494) spring-boot: use ApplicationContextRunner in spring-boot test to test AutoConfigurations
[ https://issues.apache.org/jira/browse/CAMEL-12494?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16480415#comment-16480415 ] ASF GitHub Bot commented on CAMEL-12494: oscerd commented on issue #2343: CAMEL-12494:spring-boot: use ApplicationContextRunner in spring-boot … URL: https://github.com/apache/camel/pull/2343#issuecomment-390154162 merged on master This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > spring-boot: use ApplicationContextRunner in spring-boot test to test > AutoConfigurations > > > Key: CAMEL-12494 > URL: https://issues.apache.org/jira/browse/CAMEL-12494 > Project: Camel > Issue Type: Task > Components: camel-spring-boot, camel-spring-boot-starters >Reporter: Luca Burgazzoli >Assignee: Andrea Cosentino >Priority: Minor > Fix For: 2.22.0 > > > We should migrate AutoConfigurations related test to use > ApplicationContextRunner, see: > https://spring.io/blog/2018/03/07/testing-auto-configurations-with-spring-boot-2-0 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CAMEL-12494) spring-boot: use ApplicationContextRunner in spring-boot test to test AutoConfigurations
[ https://issues.apache.org/jira/browse/CAMEL-12494?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16480416#comment-16480416 ] ASF GitHub Bot commented on CAMEL-12494: oscerd closed pull request #2343: CAMEL-12494:spring-boot: use ApplicationContextRunner in spring-boot … URL: https://github.com/apache/camel/pull/2343 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/CamelAutoConfigurationWithContextRunnerTest.java b/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/CamelAutoConfigurationWithContextRunnerTest.java new file mode 100644 index 000..d08fe4cc91d --- /dev/null +++ b/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/CamelAutoConfigurationWithContextRunnerTest.java @@ -0,0 +1,54 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.spring.boot; + +import org.junit.Test; +import org.springframework.boot.autoconfigure.AutoConfigurations; +import org.springframework.boot.test.context.runner.ApplicationContextRunner; + +import static org.assertj.core.api.Assertions.assertThat; + +public class CamelAutoConfigurationWithContextRunnerTest { +@Test +public void testCamelAnnotationsAutoConfigurationBean() { +new ApplicationContextRunner() +.withConfiguration( +AutoConfigurations.of( +CamelAutoConfigurationTest.class, +RouteConfigWithCamelContextInjected.class, +CamelAutoConfigurationWithContextRunnerTest.class +) +) +.withPropertyValues( +"camel.springboot.consumerTemplateCacheSize=100", +"camel.springboot.jmxEnabled=true", +"camel.springboot.name=customName", +"camel.springboot.typeConversion=true", +"camel.springboot.threadNamePattern=customThreadName #counter#" +) +.run((context) -> { + assertThat(context).doesNotHaveBean(CamelAnnotationsTest.TestConfig.class); + assertThat(context).doesNotHaveBean(CamelAnnotationsTest.class); + assertThat(context).getBeanNames(CamelAutoConfigurationTest.class).hasSize(1); + assertThat(context).hasSingleBean(RouteConfigWithCamelContextInjected.class); + assertThat(context).getBean(CamelAutoConfigurationTest.class).hasNoNullFieldsOrProperties(); + +} +); +} + +} diff --git a/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/cloud/CamelCloudServiceCallConfigurationTest.java b/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/cloud/CamelCloudServiceCallConfigurationTest.java index 42263230458..952ac0ce607 100644 --- a/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/cloud/CamelCloudServiceCallConfigurationTest.java +++ b/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/cloud/CamelCloudServiceCallConfigurationTest.java @@ -22,55 +22,50 @@ import org.apache.camel.cloud.ServiceFilter; import org.apache.camel.cloud.ServiceLoadBalancer; import org.apache.camel.spring.boot.CamelAutoConfiguration; + import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.ApplicationContext; -import org.springframework.core.env.Environment; -import org.springframework.test.annotation.DirtiesContext; -import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.boot.aut
[jira] [Commented] (CAMEL-12494) spring-boot: use ApplicationContextRunner in spring-boot test to test AutoConfigurations
[ https://issues.apache.org/jira/browse/CAMEL-12494?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16478391#comment-16478391 ] ASF GitHub Bot commented on CAMEL-12494: ramu11 commented on issue #2343: CAMEL-12494:spring-boot: use ApplicationContextRunner in spring-boot … URL: https://github.com/apache/camel/pull/2343#issuecomment-389723171 Done This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > spring-boot: use ApplicationContextRunner in spring-boot test to test > AutoConfigurations > > > Key: CAMEL-12494 > URL: https://issues.apache.org/jira/browse/CAMEL-12494 > Project: Camel > Issue Type: Task > Components: camel-spring-boot, camel-spring-boot-starters >Reporter: Luca Burgazzoli >Priority: Minor > Fix For: 2.22.0 > > > We should migrate AutoConfigurations related test to use > ApplicationContextRunner, see: > https://spring.io/blog/2018/03/07/testing-auto-configurations-with-spring-boot-2-0 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CAMEL-12494) spring-boot: use ApplicationContextRunner in spring-boot test to test AutoConfigurations
[ https://issues.apache.org/jira/browse/CAMEL-12494?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16477148#comment-16477148 ] ASF GitHub Bot commented on CAMEL-12494: lburgazzoli commented on issue #2343: CAMEL-12494:spring-boot: use ApplicationContextRunner in spring-boot … URL: https://github.com/apache/camel/pull/2343#issuecomment-389454109 looks good to me, can you please re-format/indent the test so they all have the same style ? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > spring-boot: use ApplicationContextRunner in spring-boot test to test > AutoConfigurations > > > Key: CAMEL-12494 > URL: https://issues.apache.org/jira/browse/CAMEL-12494 > Project: Camel > Issue Type: Task > Components: camel-spring-boot, camel-spring-boot-starters >Reporter: Luca Burgazzoli >Priority: Minor > Fix For: 2.22.0 > > > We should migrate AutoConfigurations related test to use > ApplicationContextRunner, see: > https://spring.io/blog/2018/03/07/testing-auto-configurations-with-spring-boot-2-0 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CAMEL-12494) spring-boot: use ApplicationContextRunner in spring-boot test to test AutoConfigurations
[ https://issues.apache.org/jira/browse/CAMEL-12494?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16477117#comment-16477117 ] ASF GitHub Bot commented on CAMEL-12494: ramu11 commented on issue #2343: CAMEL-12494:spring-boot: use ApplicationContextRunner in spring-boot … URL: https://github.com/apache/camel/pull/2343#issuecomment-389449108 @Luca Burgazzoli Could you please review This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > spring-boot: use ApplicationContextRunner in spring-boot test to test > AutoConfigurations > > > Key: CAMEL-12494 > URL: https://issues.apache.org/jira/browse/CAMEL-12494 > Project: Camel > Issue Type: Task > Components: camel-spring-boot, camel-spring-boot-starters >Reporter: Luca Burgazzoli >Priority: Minor > Fix For: 2.22.0 > > > We should migrate AutoConfigurations related test to use > ApplicationContextRunner, see: > https://spring.io/blog/2018/03/07/testing-auto-configurations-with-spring-boot-2-0 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CAMEL-12494) spring-boot: use ApplicationContextRunner in spring-boot test to test AutoConfigurations
[ https://issues.apache.org/jira/browse/CAMEL-12494?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16477125#comment-16477125 ] ASF GitHub Bot commented on CAMEL-12494: ramu11 commented on issue #2343: CAMEL-12494:spring-boot: use ApplicationContextRunner in spring-boot … URL: https://github.com/apache/camel/pull/2343#issuecomment-389449108 @lburgazzoliCould you please review This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > spring-boot: use ApplicationContextRunner in spring-boot test to test > AutoConfigurations > > > Key: CAMEL-12494 > URL: https://issues.apache.org/jira/browse/CAMEL-12494 > Project: Camel > Issue Type: Task > Components: camel-spring-boot, camel-spring-boot-starters >Reporter: Luca Burgazzoli >Priority: Minor > Fix For: 2.22.0 > > > We should migrate AutoConfigurations related test to use > ApplicationContextRunner, see: > https://spring.io/blog/2018/03/07/testing-auto-configurations-with-spring-boot-2-0 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CAMEL-12494) spring-boot: use ApplicationContextRunner in spring-boot test to test AutoConfigurations
[ https://issues.apache.org/jira/browse/CAMEL-12494?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16476889#comment-16476889 ] ASF GitHub Bot commented on CAMEL-12494: GitHub user ramu11 opened a pull request: https://github.com/apache/camel/pull/2343 CAMEL-12494:spring-boot: use ApplicationContextRunner in spring-boot … CAMEL-12494:spring-boot: use ApplicationContextRunner in spring-boot test to test AutoConfigurations You can merge this pull request into a Git repository by running: $ git pull https://github.com/ramu11/camel master Alternatively you can review and apply these changes as the patch at: https://github.com/apache/camel/pull/2343.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #2343 commit 8bb9a86f3e1b4299d353e909488f26830e452794 Author: Ramu Date: 2018-05-16T05:52:52Z CAMEL-12494:spring-boot: use ApplicationContextRunner in spring-boot test to test AutoConfigurations > spring-boot: use ApplicationContextRunner in spring-boot test to test > AutoConfigurations > > > Key: CAMEL-12494 > URL: https://issues.apache.org/jira/browse/CAMEL-12494 > Project: Camel > Issue Type: Task > Components: camel-spring-boot, camel-spring-boot-starters >Reporter: Luca Burgazzoli >Priority: Minor > Fix For: 2.22.0 > > > We should migrate AutoConfigurations related test to use > ApplicationContextRunner, see: > https://spring.io/blog/2018/03/07/testing-auto-configurations-with-spring-boot-2-0 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CAMEL-12494) spring-boot: use ApplicationContextRunner in spring-boot test to test AutoConfigurations
[ https://issues.apache.org/jira/browse/CAMEL-12494?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16476888#comment-16476888 ] ASF GitHub Bot commented on CAMEL-12494: ramu11 opened a new pull request #2343: CAMEL-12494:spring-boot: use ApplicationContextRunner in spring-boot … URL: https://github.com/apache/camel/pull/2343 CAMEL-12494:spring-boot: use ApplicationContextRunner in spring-boot test to test AutoConfigurations This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > spring-boot: use ApplicationContextRunner in spring-boot test to test > AutoConfigurations > > > Key: CAMEL-12494 > URL: https://issues.apache.org/jira/browse/CAMEL-12494 > Project: Camel > Issue Type: Task > Components: camel-spring-boot, camel-spring-boot-starters >Reporter: Luca Burgazzoli >Priority: Minor > Fix For: 2.22.0 > > > We should migrate AutoConfigurations related test to use > ApplicationContextRunner, see: > https://spring.io/blog/2018/03/07/testing-auto-configurations-with-spring-boot-2-0 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CAMEL-12494) spring-boot: use ApplicationContextRunner in spring-boot test to test AutoConfigurations
[ https://issues.apache.org/jira/browse/CAMEL-12494?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16471629#comment-16471629 ] Ramu kakarla commented on CAMEL-12494: --- working on this > spring-boot: use ApplicationContextRunner in spring-boot test to test > AutoConfigurations > > > Key: CAMEL-12494 > URL: https://issues.apache.org/jira/browse/CAMEL-12494 > Project: Camel > Issue Type: Task > Components: camel-spring-boot, camel-spring-boot-starters >Reporter: Luca Burgazzoli >Priority: Minor > Fix For: 2.22.0 > > > We should migrate AutoConfigurations related test to use > ApplicationContextRunner, see: > https://spring.io/blog/2018/03/07/testing-auto-configurations-with-spring-boot-2-0 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CAMEL-12494) spring-boot: use ApplicationContextRunner in spring-boot test to test AutoConfigurations
[ https://issues.apache.org/jira/browse/CAMEL-12494?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16469889#comment-16469889 ] Ramu kakarla commented on CAMEL-12494: --- looking > spring-boot: use ApplicationContextRunner in spring-boot test to test > AutoConfigurations > > > Key: CAMEL-12494 > URL: https://issues.apache.org/jira/browse/CAMEL-12494 > Project: Camel > Issue Type: Task > Components: camel-spring-boot, camel-spring-boot-starters >Reporter: Luca Burgazzoli >Priority: Minor > Fix For: 2.22.0 > > > We should migrate AutoConfigurations related test to use > ApplicationContextRunner, see: > https://spring.io/blog/2018/03/07/testing-auto-configurations-with-spring-boot-2-0 -- This message was sent by Atlassian JIRA (v7.6.3#76005)