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 3947f589b584cbd3ecd33ceddad0e72a876d7c84 Author: Guillaume Nodet <[email protected]> AuthorDate: Mon Jul 20 14:24:35 2020 +0200 [CAMEL-11807] Upgrade camel-robotframework to junit5 --- components/camel-robotframework/pom.xml | 2 +- .../RobotFrameworkCamelConfigurationTest.java | 6 ++-- .../RobotFrameworkCamelUtilsTest.java | 33 ++++++++++++---------- .../RobotFrameworkComponentTest.java | 6 ++-- 4 files changed, 27 insertions(+), 20 deletions(-) diff --git a/components/camel-robotframework/pom.xml b/components/camel-robotframework/pom.xml index 543d5fb..eacdff0 100644 --- a/components/camel-robotframework/pom.xml +++ b/components/camel-robotframework/pom.xml @@ -66,7 +66,7 @@ <!-- testing --> <dependency> <groupId>org.apache.camel</groupId> - <artifactId>camel-test</artifactId> + <artifactId>camel-test-junit5</artifactId> <scope>test</scope> </dependency> </dependencies> diff --git a/components/camel-robotframework/src/test/java/org/apache/camel/component/robotframework/RobotFrameworkCamelConfigurationTest.java b/components/camel-robotframework/src/test/java/org/apache/camel/component/robotframework/RobotFrameworkCamelConfigurationTest.java index 1baadf9..cb0570c 100644 --- a/components/camel-robotframework/src/test/java/org/apache/camel/component/robotframework/RobotFrameworkCamelConfigurationTest.java +++ b/components/camel-robotframework/src/test/java/org/apache/camel/component/robotframework/RobotFrameworkCamelConfigurationTest.java @@ -16,8 +16,10 @@ */ package org.apache.camel.component.robotframework; -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; public class RobotFrameworkCamelConfigurationTest extends CamelTestSupport { diff --git a/components/camel-robotframework/src/test/java/org/apache/camel/component/robotframework/RobotFrameworkCamelUtilsTest.java b/components/camel-robotframework/src/test/java/org/apache/camel/component/robotframework/RobotFrameworkCamelUtilsTest.java index 638b44a..556b1b8 100644 --- a/components/camel-robotframework/src/test/java/org/apache/camel/component/robotframework/RobotFrameworkCamelUtilsTest.java +++ b/components/camel-robotframework/src/test/java/org/apache/camel/component/robotframework/RobotFrameworkCamelUtilsTest.java @@ -24,9 +24,12 @@ import java.util.Map; 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.apache.camel.test.junit5.CamelTestSupport; import org.apache.camel.util.ObjectHelper; -import org.junit.Test; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; public class RobotFrameworkCamelUtilsTest extends CamelTestSupport { @@ -66,43 +69,43 @@ public class RobotFrameworkCamelUtilsTest extends CamelTestSupport { List<String> camelRobotVariables = ObjectHelper.cast(List.class, responseExchange.getIn().getHeader(RobotFrameworkCamelConstants.CAMEL_ROBOT_VARIABLES)); for (String camelRobotVariable : camelRobotVariables) { if (!camelRobotVariable.contains("headers") && !camelRobotVariable.contains("properties") && camelRobotVariable.contains("body")) { - assertEquals("Body variable content should be [body:<body_value>]", "body:Hello Robot", camelRobotVariable); + assertEquals("body:Hello Robot", camelRobotVariable, "Body variable content should be [body:<body_value>]"); } if (camelRobotVariable.contains("headers") && camelRobotVariable.contains("stringKey")) { - assertEquals("Header variable content should be [headers.stringKey:<header_value>]", "headers.stringKey:str1", camelRobotVariable); + assertEquals("headers.stringKey:str1", camelRobotVariable, "Header variable content should be [headers.stringKey:<header_value>]"); } if (camelRobotVariable.contains("headers") && camelRobotVariable.contains("numericIntKey")) { - assertEquals("Header variable content should be [headers.numericIntKey:<header_value>]", "headers.numericIntKey:1", camelRobotVariable); + assertEquals("headers.numericIntKey:1", camelRobotVariable, "Header variable content should be [headers.numericIntKey:<header_value>]"); } if (camelRobotVariable.contains("headers") && camelRobotVariable.contains("numericBigDecimalKey")) { - assertEquals("Header variable content should be [headers.numericIntKey:<header_value>]", "headers.numericBigDecimalKey:2", camelRobotVariable); + assertEquals("headers.numericBigDecimalKey:2", camelRobotVariable, "Header variable content should be [headers.numericIntKey:<header_value>]"); } if (camelRobotVariable.contains("headers") && camelRobotVariable.contains("innerStringKey")) { - assertEquals("Header variable content should be [headers.stringKey:<header_value>]", "headers.inner.innerStringKey:str1", camelRobotVariable); + assertEquals("headers.inner.innerStringKey:str1", camelRobotVariable, "Header variable content should be [headers.stringKey:<header_value>]"); } if (camelRobotVariable.contains("headers") && camelRobotVariable.contains("innerNumericIntKey")) { - assertEquals("Header variable content should be [headers.numericIntKey:<header_value>]", "headers.inner.innerNumericIntKey:1", camelRobotVariable); + assertEquals("headers.inner.innerNumericIntKey:1", camelRobotVariable, "Header variable content should be [headers.numericIntKey:<header_value>]"); } if (camelRobotVariable.contains("headers") && camelRobotVariable.contains("innerNumericBigDecimalKey")) { - assertEquals("Header variable content should be [headers.numericIntKey:<header_value>]", "headers.inner.innerNumericBigDecimalKey:2", camelRobotVariable); + assertEquals("headers.inner.innerNumericBigDecimalKey:2", camelRobotVariable, "Header variable content should be [headers.numericIntKey:<header_value>]"); } if (camelRobotVariable.contains("properties") && camelRobotVariable.contains("stringKey")) { - assertEquals("Header variable content should be [properties.stringKey:<header_value>]", "properties.stringKey:str1", camelRobotVariable); + assertEquals("properties.stringKey:str1", camelRobotVariable, "Header variable content should be [properties.stringKey:<header_value>]"); } if (camelRobotVariable.contains("properties") && camelRobotVariable.contains("numericIntKey")) { - assertEquals("Header variable content should be [properties.numericIntKey:<header_value>]", "properties.numericIntKey:1", camelRobotVariable); + assertEquals("properties.numericIntKey:1", camelRobotVariable, "Header variable content should be [properties.numericIntKey:<header_value>]"); } if (camelRobotVariable.contains("properties") && camelRobotVariable.contains("numericBigDecimalKey")) { - assertEquals("Header variable content should be [properties.numericIntKey:<header_value>]", "properties.numericBigDecimalKey:2", camelRobotVariable); + assertEquals("properties.numericBigDecimalKey:2", camelRobotVariable, "Header variable content should be [properties.numericIntKey:<header_value>]"); } if (camelRobotVariable.contains("properties") && camelRobotVariable.contains("innerStringKey")) { - assertEquals("Header variable content should be [properties.stringKey:<header_value>]", "properties.inner.innerStringKey:str1", camelRobotVariable); + assertEquals("properties.inner.innerStringKey:str1", camelRobotVariable, "Header variable content should be [properties.stringKey:<header_value>]"); } if (camelRobotVariable.contains("properties") && camelRobotVariable.contains("innerNumericIntKey")) { - assertEquals("Header variable content should be [properties.numericIntKey:<header_value>]", "properties.inner.innerNumericIntKey:1", camelRobotVariable); + assertEquals("properties.inner.innerNumericIntKey:1", camelRobotVariable, "Header variable content should be [properties.numericIntKey:<header_value>]"); } if (camelRobotVariable.contains("properties") && camelRobotVariable.contains("innerNumericBigDecimalKey")) { - assertEquals("Header variable content should be [properties.numericIntKey:<header_value>]", "properties.inner.innerNumericBigDecimalKey:2", camelRobotVariable); + assertEquals("properties.inner.innerNumericBigDecimalKey:2", camelRobotVariable, "Header variable content should be [properties.numericIntKey:<header_value>]"); } } diff --git a/components/camel-robotframework/src/test/java/org/apache/camel/component/robotframework/RobotFrameworkComponentTest.java b/components/camel-robotframework/src/test/java/org/apache/camel/component/robotframework/RobotFrameworkComponentTest.java index 4f1ab51..9a4c7d0 100644 --- a/components/camel-robotframework/src/test/java/org/apache/camel/component/robotframework/RobotFrameworkComponentTest.java +++ b/components/camel-robotframework/src/test/java/org/apache/camel/component/robotframework/RobotFrameworkComponentTest.java @@ -21,9 +21,11 @@ import java.io.File; 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.apache.camel.test.junit5.CamelTestSupport; import org.apache.camel.util.ObjectHelper; -import org.junit.Test; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertTrue; public class RobotFrameworkComponentTest extends CamelTestSupport {
