This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-spring-boot-examples.git
commit 47b432532729a43a2e6969594c0251ddcbb49943 Author: Claus Ibsen <claus.ib...@gmail.com> AuthorDate: Mon Aug 24 13:46:46 2020 +0200 CAMEL-15428: camel-spring-boot BOM with just the starter JARs --- camel-example-spring-boot/pom.xml | 17 +------ .../sample/camel/FooApplicationJUnit5Test.java | 3 +- .../test/java/sample/camel/FooApplicationTest.java | 53 ---------------------- .../sample/camel/MyCamelApplicationJUnit5Test.java | 3 +- .../java/sample/camel/MyCamelApplicationTest.java | 49 -------------------- 5 files changed, 4 insertions(+), 121 deletions(-) diff --git a/camel-example-spring-boot/pom.xml b/camel-example-spring-boot/pom.xml index b2987ce..ad6c517 100644 --- a/camel-example-spring-boot/pom.xml +++ b/camel-example-spring-boot/pom.xml @@ -52,8 +52,8 @@ <!-- Camel BOM --> <dependency> <groupId>org.apache.camel.springboot</groupId> - <artifactId>camel-spring-boot-dependencies</artifactId> - <version>${project.version}</version> + <artifactId>camel-spring-boot-bom</artifactId> + <version>${camel-version}</version> <type>pom</type> <scope>import</scope> </dependency> @@ -137,19 +137,6 @@ </execution> </executions> </plugin> - - <plugin> - <groupId>org.apache.camel</groupId> - <artifactId>camel-maven-plugin</artifactId> - <version>${camel-version}</version> - <!-- allows to fail if not all routes are covered during testing --> - <!-- - <configuration> - <failOnError>true</failOnError> - <coverageThreshold>90</coverageThreshold> - </configuration> - --> - </plugin> </plugins> </build> </project> diff --git a/camel-example-spring-boot/src/test/java/sample/camel/FooApplicationJUnit5Test.java b/camel-example-spring-boot/src/test/java/sample/camel/FooApplicationJUnit5Test.java index 5e88f59..c82a95b 100644 --- a/camel-example-spring-boot/src/test/java/sample/camel/FooApplicationJUnit5Test.java +++ b/camel-example-spring-boot/src/test/java/sample/camel/FooApplicationJUnit5Test.java @@ -21,18 +21,17 @@ import java.util.concurrent.TimeUnit; import org.apache.camel.CamelContext; import org.apache.camel.builder.NotifyBuilder; import org.apache.camel.test.spring.junit5.CamelSpringBootTest; -import org.apache.camel.test.spring.junit5.EnableRouteCoverage; import org.apache.camel.test.spring.junit5.MockEndpoints; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; + import static org.junit.Assert.assertTrue; @CamelSpringBootTest @SpringBootTest(classes = MyCamelApplication.class, properties = "greeting = Hello foo") -@EnableRouteCoverage @MockEndpoints("log:foo") // mock the log:foo endpoint => mock:log:foo which we then use in the testing //@Ignore // enable me to run this test as well so we can cover testing the route completely public class FooApplicationJUnit5Test { diff --git a/camel-example-spring-boot/src/test/java/sample/camel/FooApplicationTest.java b/camel-example-spring-boot/src/test/java/sample/camel/FooApplicationTest.java deleted file mode 100644 index 10b8116..0000000 --- a/camel-example-spring-boot/src/test/java/sample/camel/FooApplicationTest.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * 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 sample.camel; - -import java.util.concurrent.TimeUnit; - -import org.apache.camel.CamelContext; -import org.apache.camel.builder.NotifyBuilder; -import org.apache.camel.test.spring.CamelSpringBootRunner; -import org.apache.camel.test.spring.EnableRouteCoverage; -import org.apache.camel.test.spring.MockEndpoints; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; - -import static org.junit.Assert.assertTrue; - -@RunWith(CamelSpringBootRunner.class) -@SpringBootTest(classes = MyCamelApplication.class, - properties = "greeting = Hello foo") -@EnableRouteCoverage -@MockEndpoints("log:foo") // mock the log:foo endpoint => mock:log:foo which we then use in the testing -//@Ignore // enable me to run this test as well so we can cover testing the route completely -public class FooApplicationTest { - - @Autowired - private CamelContext camelContext; - - @Test - public void shouldSayFoo() throws Exception { - // we expect that one or more messages is automatic done by the Camel - // route as it uses a timer to trigger - NotifyBuilder notify = new NotifyBuilder(camelContext).whenDone(1).create(); - - assertTrue(notify.matches(10, TimeUnit.SECONDS)); - } - -} diff --git a/camel-example-spring-boot/src/test/java/sample/camel/MyCamelApplicationJUnit5Test.java b/camel-example-spring-boot/src/test/java/sample/camel/MyCamelApplicationJUnit5Test.java index b990532..a11f87d 100644 --- a/camel-example-spring-boot/src/test/java/sample/camel/MyCamelApplicationJUnit5Test.java +++ b/camel-example-spring-boot/src/test/java/sample/camel/MyCamelApplicationJUnit5Test.java @@ -21,16 +21,15 @@ import java.util.concurrent.TimeUnit; import org.apache.camel.CamelContext; import org.apache.camel.builder.NotifyBuilder; import org.apache.camel.test.spring.junit5.CamelSpringBootTest; -import org.apache.camel.test.spring.junit5.EnableRouteCoverage; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; + import static org.junit.Assert.assertTrue; @CamelSpringBootTest @SpringBootTest(classes = MyCamelApplication.class) -@EnableRouteCoverage public class MyCamelApplicationJUnit5Test { @Autowired diff --git a/camel-example-spring-boot/src/test/java/sample/camel/MyCamelApplicationTest.java b/camel-example-spring-boot/src/test/java/sample/camel/MyCamelApplicationTest.java deleted file mode 100644 index ccf7a64..0000000 --- a/camel-example-spring-boot/src/test/java/sample/camel/MyCamelApplicationTest.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * 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 sample.camel; - -import java.util.concurrent.TimeUnit; - -import org.apache.camel.CamelContext; -import org.apache.camel.builder.NotifyBuilder; -import org.apache.camel.test.spring.CamelSpringBootRunner; -import org.apache.camel.test.spring.EnableRouteCoverage; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; - -import static org.junit.Assert.assertTrue; - -@RunWith(CamelSpringBootRunner.class) -@SpringBootTest(classes = MyCamelApplication.class) -@EnableRouteCoverage -public class MyCamelApplicationTest { - - @Autowired - private CamelContext camelContext; - - @Test - public void shouldProduceMessages() throws Exception { - // we expect that one or more messages is automatic done by the Camel - // route as it uses a timer to trigger - NotifyBuilder notify = new NotifyBuilder(camelContext).whenDone(1).create(); - - assertTrue(notify.matches(10, TimeUnit.SECONDS)); - } - -}