This is an automated email from the ASF dual-hosted git repository. gnodet pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel.git
commit 74798b94c0fa811cbb8ba45c137a988b2c878be9 Author: Guillaume Nodet <[email protected]> AuthorDate: Wed Jun 24 17:58:17 2020 +0200 [CAMEL-11807] Upgrade camel-freemarker to junit5 --- components/camel-freemarker/pom.xml | 6 +++--- .../freemarker/FreemarkerBodyAsDomainObjectTest.java | 4 ++-- .../component/freemarker/FreemarkerConcurrentTest.java | 6 ++++-- .../component/freemarker/FreemarkerContentCacheTest.java | 8 ++++---- .../camel/component/freemarker/FreemarkerLetterTest.java | 4 ++-- .../freemarker/FreemarkerOverrideHeaderTest.java | 6 ++++-- .../component/freemarker/FreemarkerSetHeaderTest.java | 4 ++-- .../freemarker/FreemarkerTemplateInHeaderTest.java | 15 +++++++++------ .../apache/camel/component/freemarker/FreemarkerTest.java | 6 ++++-- .../freemarker/FreemarkerValuesInPropertiesTest.java | 4 ++-- 10 files changed, 36 insertions(+), 27 deletions(-) diff --git a/components/camel-freemarker/pom.xml b/components/camel-freemarker/pom.xml index 14291d7..4b438a0 100644 --- a/components/camel-freemarker/pom.xml +++ b/components/camel-freemarker/pom.xml @@ -52,7 +52,7 @@ <!-- testing --> <dependency> <groupId>org.apache.camel</groupId> - <artifactId>camel-test-spring</artifactId> + <artifactId>camel-test-spring-junit5</artifactId> <scope>test</scope> </dependency> <dependency> @@ -67,8 +67,8 @@ <scope>test</scope> </dependency> <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> + <groupId>org.junit.jupiter</groupId> + <artifactId>junit-jupiter</artifactId> <scope>test</scope> </dependency> </dependencies> diff --git a/components/camel-freemarker/src/test/java/org/apache/camel/component/freemarker/FreemarkerBodyAsDomainObjectTest.java b/components/camel-freemarker/src/test/java/org/apache/camel/component/freemarker/FreemarkerBodyAsDomainObjectTest.java index 2a0f4f1..0c4bbd9 100644 --- a/components/camel-freemarker/src/test/java/org/apache/camel/component/freemarker/FreemarkerBodyAsDomainObjectTest.java +++ b/components/camel-freemarker/src/test/java/org/apache/camel/component/freemarker/FreemarkerBodyAsDomainObjectTest.java @@ -18,8 +18,8 @@ package org.apache.camel.component.freemarker; import org.apache.camel.builder.RouteBuilder; import org.apache.camel.component.mock.MockEndpoint; -import org.apache.camel.test.junit4.CamelTestSupport; -import org.junit.Test; +import org.apache.camel.test.junit5.CamelTestSupport; +import org.junit.jupiter.api.Test; /** * Unit test with the body as a Domain object. diff --git a/components/camel-freemarker/src/test/java/org/apache/camel/component/freemarker/FreemarkerConcurrentTest.java b/components/camel-freemarker/src/test/java/org/apache/camel/component/freemarker/FreemarkerConcurrentTest.java index 70c800a..3005d56 100644 --- a/components/camel-freemarker/src/test/java/org/apache/camel/component/freemarker/FreemarkerConcurrentTest.java +++ b/components/camel-freemarker/src/test/java/org/apache/camel/component/freemarker/FreemarkerConcurrentTest.java @@ -21,8 +21,10 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import org.apache.camel.builder.RouteBuilder; -import org.apache.camel.test.junit4.CamelTestSupport; -import org.junit.Test; +import org.apache.camel.test.junit5.CamelTestSupport; +import org.junit.jupiter.api.Test; + +import static org.apache.camel.test.junit5.TestSupport.body; public class FreemarkerConcurrentTest extends CamelTestSupport { diff --git a/components/camel-freemarker/src/test/java/org/apache/camel/component/freemarker/FreemarkerContentCacheTest.java b/components/camel-freemarker/src/test/java/org/apache/camel/component/freemarker/FreemarkerContentCacheTest.java index b4efc4d..dbeb3a1 100644 --- a/components/camel-freemarker/src/test/java/org/apache/camel/component/freemarker/FreemarkerContentCacheTest.java +++ b/components/camel-freemarker/src/test/java/org/apache/camel/component/freemarker/FreemarkerContentCacheTest.java @@ -25,9 +25,9 @@ import javax.management.ObjectName; import org.apache.camel.Exchange; import org.apache.camel.builder.RouteBuilder; import org.apache.camel.component.mock.MockEndpoint; -import org.apache.camel.test.junit4.CamelTestSupport; -import org.junit.Before; -import org.junit.Test; +import org.apache.camel.test.junit5.CamelTestSupport; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; /** * Unit test the cache when reloading .ftl files in the classpath @@ -40,7 +40,7 @@ public class FreemarkerContentCacheTest extends CamelTestSupport { } @Override - @Before + @BeforeEach public void setUp() throws Exception { super.setUp(); diff --git a/components/camel-freemarker/src/test/java/org/apache/camel/component/freemarker/FreemarkerLetterTest.java b/components/camel-freemarker/src/test/java/org/apache/camel/component/freemarker/FreemarkerLetterTest.java index 8ad67bb..7c60476 100644 --- a/components/camel-freemarker/src/test/java/org/apache/camel/component/freemarker/FreemarkerLetterTest.java +++ b/components/camel-freemarker/src/test/java/org/apache/camel/component/freemarker/FreemarkerLetterTest.java @@ -20,8 +20,8 @@ import org.apache.camel.Exchange; import org.apache.camel.Message; import org.apache.camel.builder.RouteBuilder; import org.apache.camel.component.mock.MockEndpoint; -import org.apache.camel.test.junit4.CamelTestSupport; -import org.junit.Test; +import org.apache.camel.test.junit5.CamelTestSupport; +import org.junit.jupiter.api.Test; /** * Unit test for wiki documentation diff --git a/components/camel-freemarker/src/test/java/org/apache/camel/component/freemarker/FreemarkerOverrideHeaderTest.java b/components/camel-freemarker/src/test/java/org/apache/camel/component/freemarker/FreemarkerOverrideHeaderTest.java index 8191b68..d83a79c 100644 --- a/components/camel-freemarker/src/test/java/org/apache/camel/component/freemarker/FreemarkerOverrideHeaderTest.java +++ b/components/camel-freemarker/src/test/java/org/apache/camel/component/freemarker/FreemarkerOverrideHeaderTest.java @@ -20,8 +20,10 @@ import org.apache.camel.Exchange; import org.apache.camel.Message; import org.apache.camel.builder.RouteBuilder; import org.apache.camel.component.mock.MockEndpoint; -import org.apache.camel.test.junit4.CamelTestSupport; -import org.junit.Test; +import org.apache.camel.test.junit5.CamelTestSupport; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertTrue; public class FreemarkerOverrideHeaderTest extends CamelTestSupport { diff --git a/components/camel-freemarker/src/test/java/org/apache/camel/component/freemarker/FreemarkerSetHeaderTest.java b/components/camel-freemarker/src/test/java/org/apache/camel/component/freemarker/FreemarkerSetHeaderTest.java index 487eb0c..5c86006 100644 --- a/components/camel-freemarker/src/test/java/org/apache/camel/component/freemarker/FreemarkerSetHeaderTest.java +++ b/components/camel-freemarker/src/test/java/org/apache/camel/component/freemarker/FreemarkerSetHeaderTest.java @@ -20,8 +20,8 @@ import org.apache.camel.Exchange; import org.apache.camel.Message; import org.apache.camel.Processor; import org.apache.camel.component.mock.MockEndpoint; -import org.apache.camel.test.spring.CamelSpringTestSupport; -import org.junit.Test; +import org.apache.camel.test.spring.junit5.CamelSpringTestSupport; +import org.junit.jupiter.api.Test; import org.springframework.context.support.ClassPathXmlApplicationContext; public class FreemarkerSetHeaderTest extends CamelSpringTestSupport { diff --git a/components/camel-freemarker/src/test/java/org/apache/camel/component/freemarker/FreemarkerTemplateInHeaderTest.java b/components/camel-freemarker/src/test/java/org/apache/camel/component/freemarker/FreemarkerTemplateInHeaderTest.java index bea8cc7..691ab80 100644 --- a/components/camel-freemarker/src/test/java/org/apache/camel/component/freemarker/FreemarkerTemplateInHeaderTest.java +++ b/components/camel-freemarker/src/test/java/org/apache/camel/component/freemarker/FreemarkerTemplateInHeaderTest.java @@ -24,8 +24,12 @@ import org.apache.camel.InvalidPayloadException; import org.apache.camel.Message; import org.apache.camel.Processor; import org.apache.camel.builder.RouteBuilder; -import org.apache.camel.test.junit4.CamelTestSupport; -import org.junit.Test; +import org.apache.camel.test.junit5.CamelTestSupport; +import org.junit.jupiter.api.Test; + +import static org.apache.camel.test.junit5.TestSupport.assertMessageBodyEquals; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; public class FreemarkerTemplateInHeaderTest extends CamelTestSupport { @@ -57,10 +61,10 @@ public class FreemarkerTemplateInHeaderTest extends CamelTestSupport { in.setHeader(headerName, headerValue); } }); - assertOutMessageBodyEquals(response, expectedBody); + assertMessageBodyEquals(response, expectedBody); Object template = response.getMessage().getHeader(FreemarkerConstants.FREEMARKER_TEMPLATE); - assertNull("Template header should have been removed", template); + assertNull(template, "Template header should have been removed"); Set<Entry<String, Object>> entrySet = response.getMessage().getHeaders().entrySet(); boolean keyFound = false; @@ -69,8 +73,7 @@ public class FreemarkerTemplateInHeaderTest extends CamelTestSupport { keyFound = true; } } - assertTrue("Header should been found", keyFound); - + assertTrue(keyFound, "Header should been found"); } @Override diff --git a/components/camel-freemarker/src/test/java/org/apache/camel/component/freemarker/FreemarkerTest.java b/components/camel-freemarker/src/test/java/org/apache/camel/component/freemarker/FreemarkerTest.java index 2fd8388..fdb91b0 100644 --- a/components/camel-freemarker/src/test/java/org/apache/camel/component/freemarker/FreemarkerTest.java +++ b/components/camel-freemarker/src/test/java/org/apache/camel/component/freemarker/FreemarkerTest.java @@ -22,8 +22,10 @@ import java.util.Map; import org.apache.camel.Exchange; import org.apache.camel.Processor; import org.apache.camel.builder.RouteBuilder; -import org.apache.camel.test.junit4.CamelTestSupport; -import org.junit.Test; +import org.apache.camel.test.junit5.CamelTestSupport; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; /** * Freemarker unit test diff --git a/components/camel-freemarker/src/test/java/org/apache/camel/component/freemarker/FreemarkerValuesInPropertiesTest.java b/components/camel-freemarker/src/test/java/org/apache/camel/component/freemarker/FreemarkerValuesInPropertiesTest.java index 00c48b6..2f23801 100644 --- a/components/camel-freemarker/src/test/java/org/apache/camel/component/freemarker/FreemarkerValuesInPropertiesTest.java +++ b/components/camel-freemarker/src/test/java/org/apache/camel/component/freemarker/FreemarkerValuesInPropertiesTest.java @@ -21,8 +21,8 @@ import org.apache.camel.Exchange; import org.apache.camel.Processor; import org.apache.camel.builder.RouteBuilder; import org.apache.camel.component.mock.MockEndpoint; -import org.apache.camel.test.junit4.CamelTestSupport; -import org.junit.Test; +import org.apache.camel.test.junit5.CamelTestSupport; +import org.junit.jupiter.api.Test; public class FreemarkerValuesInPropertiesTest extends CamelTestSupport {
