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 2803404ccfc43991c7e04c1434826891abbd391b Author: Guillaume Nodet <[email protected]> AuthorDate: Wed Jun 24 14:59:01 2020 +0200 [CAMEL-11807] Upgrade camel-flatpack to junit5 --- components/camel-flatpack/pom.xml | 6 +++--- .../src/main/docs/flatpack-component.adoc | 2 -- .../camel/component/flatpack/FlatpackEndpoint.java | 3 +-- .../camel/component/flatpack/CharsetTest.java | 15 ++++++++------- .../component/flatpack/DelimitedAllowLongTest.java | 21 +++++++++++---------- .../flatpack/DelimitedAllowShortAndLongTest.java | 21 +++++++++++---------- .../component/flatpack/DelimitedAllowShortTest.java | 21 +++++++++++---------- .../flatpack/DelimitedErrorWithUnmarshalTest.java | 11 ++++++----- .../camel/component/flatpack/DelimitedTest.java | 15 ++++++++------- .../flatpack/DelimitedWithNoDescriptorTest.java | 15 ++++++++------- .../flatpack/DelimitedWithUnmarshalTest.java | 15 ++++++++------- .../flatpack/FixedLengthAllowLongTest.java | 21 +++++++++++---------- .../flatpack/FixedLengthAllowShortAndLongTest.java | 21 +++++++++++---------- .../flatpack/FixedLengthAllowShortTest.java | 21 +++++++++++---------- .../camel/component/flatpack/FixedLengthTest.java | 17 +++++++++-------- .../flatpack/FixedLengthWithUnmarshalTest.java | 15 ++++++++------- .../flatpack/FlatpackDelimitedDataFormatTest.java | 6 ++++-- .../flatpack/FlatpackFixedLengthDataFormatTest.java | 7 +++++-- ...xedLengthWithHeaderAndTrailerDataFormatTest.java | 6 ++++-- .../component/flatpack/HeaderAndTrailerTest.java | 15 ++++++++------- .../component/flatpack/InvalidFixedLengthTest.java | 7 ++++--- .../camel/component/flatpack/NoSplitRowsTest.java | 11 ++++++----- .../camel/component/flatpack/StreamedSplitTest.java | 15 ++++++++------- .../component/flatpack/XMLNoSplitRowsTest.java | 13 +++++++------ .../camel/component/flatpack/XMLSplitRowsTest.java | 13 +++++++------ 25 files changed, 178 insertions(+), 155 deletions(-) diff --git a/components/camel-flatpack/pom.xml b/components/camel-flatpack/pom.xml index 2de420c..443a2d9 100644 --- a/components/camel-flatpack/pom.xml +++ b/components/camel-flatpack/pom.xml @@ -59,13 +59,13 @@ <!-- testing --> <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> + <groupId>org.junit.jupiter</groupId> + <artifactId>junit-jupiter</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.apache.camel</groupId> - <artifactId>camel-test-spring</artifactId> + <artifactId>camel-test-spring-junit5</artifactId> <scope>test</scope> </dependency> <dependency> diff --git a/components/camel-flatpack/src/main/docs/flatpack-component.adoc b/components/camel-flatpack/src/main/docs/flatpack-component.adoc index 8a355b6..efab23a 100644 --- a/components/camel-flatpack/src/main/docs/flatpack-component.adoc +++ b/components/camel-flatpack/src/main/docs/flatpack-component.adoc @@ -120,7 +120,6 @@ with the following path and query parameters: |=== // endpoint options: END - == Examples * `flatpack:fixed:foo.pzmap.xml` creates a fixed-width endpoint using @@ -325,5 +324,4 @@ the download page for the latest versions). </dependency> ----------------------------------------- - include::camel-spring-boot::page$flatpack-starter.adoc[] diff --git a/components/camel-flatpack/src/main/java/org/apache/camel/component/flatpack/FlatpackEndpoint.java b/components/camel-flatpack/src/main/java/org/apache/camel/component/flatpack/FlatpackEndpoint.java index 3a078c9..070baef 100644 --- a/components/camel-flatpack/src/main/java/org/apache/camel/component/flatpack/FlatpackEndpoint.java +++ b/components/camel-flatpack/src/main/java/org/apache/camel/component/flatpack/FlatpackEndpoint.java @@ -154,8 +154,7 @@ public class FlatpackEndpoint extends DefaultPollingEndpoint { return parser; } - - // Properties +// Properties //------------------------------------------------------------------------- public String getResourceUri() { diff --git a/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/CharsetTest.java b/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/CharsetTest.java index 4ab9dad..f14c25b 100644 --- a/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/CharsetTest.java +++ b/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/CharsetTest.java @@ -23,18 +23,19 @@ import org.apache.camel.EndpointInject; import org.apache.camel.Exchange; import org.apache.camel.Message; import org.apache.camel.component.mock.MockEndpoint; +import org.apache.camel.test.spring.junit5.CamelSpringTest; import org.apache.camel.util.ObjectHelper; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +@CamelSpringTest @ContextConfiguration -public class CharsetTest extends AbstractJUnit4SpringContextTests { +public class CharsetTest { private static final Logger LOG = LoggerFactory.getLogger(FixedLengthTest.class); @EndpointInject("mock:results") @@ -52,8 +53,8 @@ public class CharsetTest extends AbstractJUnit4SpringContextTests { for (Exchange exchange : list) { Message in = exchange.getIn(); Map<?, ?> body = in.getBody(Map.class); - assertNotNull("Should have found body as a Map but was: " + ObjectHelper.className(in.getBody()), body); - assertEquals("ITEM_DESC", expectedItemDesc[counter], body.get("ITEM_DESC")); + assertNotNull(body, "Should have found body as a Map but was: " + ObjectHelper.className(in.getBody())); + assertEquals(expectedItemDesc[counter], body.get("ITEM_DESC"), "ITEM_DESC"); LOG.info("Result: " + counter + " = " + body); counter++; } diff --git a/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/DelimitedAllowLongTest.java b/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/DelimitedAllowLongTest.java index e28817d..17dda65 100644 --- a/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/DelimitedAllowLongTest.java +++ b/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/DelimitedAllowLongTest.java @@ -23,18 +23,19 @@ import org.apache.camel.EndpointInject; import org.apache.camel.Exchange; import org.apache.camel.Message; import org.apache.camel.component.mock.MockEndpoint; +import org.apache.camel.test.spring.junit5.CamelSpringTest; import org.apache.camel.util.ObjectHelper; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +@CamelSpringTest @ContextConfiguration -public class DelimitedAllowLongTest extends AbstractJUnit4SpringContextTests { +public class DelimitedAllowLongTest { private static final Logger LOG = LoggerFactory.getLogger(DelimitedAllowLongTest.class); @EndpointInject("mock:results") @@ -57,10 +58,10 @@ public class DelimitedAllowLongTest extends AbstractJUnit4SpringContextTests { List<Exchange> list = results.getReceivedExchanges(); for (Exchange exchange : list) { Message in = exchange.getIn(); - assertEquals("counter", in.getHeader("camelFlatpackCounter"), counter); + assertEquals(in.getHeader("camelFlatpackCounter"), counter, "counter"); Map<?, ?> body = in.getBody(Map.class); - assertNotNull("Should have found body as a Map but was: " + ObjectHelper.className(in.getBody()), body); - assertEquals("ITEM_DESC", expectedItemDescriptions[counter], body.get("ITEM_DESC")); + assertNotNull(body, "Should have found body as a Map but was: " + ObjectHelper.className(in.getBody())); + assertEquals(expectedItemDescriptions[counter], body.get("ITEM_DESC"), "ITEM_DESC"); LOG.info("Result: " + counter + " = " + body); counter++; } @@ -75,7 +76,7 @@ public class DelimitedAllowLongTest extends AbstractJUnit4SpringContextTests { DataSetList data = exchange.getIn().getBody(DataSetList.class); int counter = 0; for (Map<String, Object> map : data) { - assertEquals("ITEM_DESC", expectedItemDescriptions[counter], map.get("ITEM_DESC")); + assertEquals(expectedItemDescriptions[counter], map.get("ITEM_DESC"), "ITEM_DESC"); counter++; } } @@ -89,7 +90,7 @@ public class DelimitedAllowLongTest extends AbstractJUnit4SpringContextTests { DataSetList data = exchange.getIn().getBody(DataSetList.class); int counter = 0; for (Map<String, Object> map : data) { - assertEquals("ITEM_DESC", expectedItemDescriptions[counter], map.get("ITEM_DESC")); + assertEquals(expectedItemDescriptions[counter], map.get("ITEM_DESC"), "ITEM_DESC"); counter++; } } diff --git a/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/DelimitedAllowShortAndLongTest.java b/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/DelimitedAllowShortAndLongTest.java index cfd75d5..0a232c4 100644 --- a/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/DelimitedAllowShortAndLongTest.java +++ b/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/DelimitedAllowShortAndLongTest.java @@ -23,18 +23,19 @@ import org.apache.camel.EndpointInject; import org.apache.camel.Exchange; import org.apache.camel.Message; import org.apache.camel.component.mock.MockEndpoint; +import org.apache.camel.test.spring.junit5.CamelSpringTest; import org.apache.camel.util.ObjectHelper; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +@CamelSpringTest @ContextConfiguration -public class DelimitedAllowShortAndLongTest extends AbstractJUnit4SpringContextTests { +public class DelimitedAllowShortAndLongTest { private static final Logger LOG = LoggerFactory.getLogger(DelimitedAllowShortAndLongTest.class); @EndpointInject("mock:results") @@ -57,10 +58,10 @@ public class DelimitedAllowShortAndLongTest extends AbstractJUnit4SpringContextT List<Exchange> list = results.getReceivedExchanges(); for (Exchange exchange : list) { Message in = exchange.getIn(); - assertEquals("counter", in.getHeader("camelFlatpackCounter"), counter); + assertEquals(in.getHeader("camelFlatpackCounter"), counter, "counter"); Map<?, ?> body = in.getBody(Map.class); - assertNotNull("Should have found body as a Map but was: " + ObjectHelper.className(in.getBody()), body); - assertEquals("ITEM_DESC", expectedItemDescriptions[counter], body.get("ITEM_DESC")); + assertNotNull(body, "Should have found body as a Map but was: " + ObjectHelper.className(in.getBody())); + assertEquals(expectedItemDescriptions[counter], body.get("ITEM_DESC"), "ITEM_DESC"); LOG.info("Result: " + counter + " = " + body); counter++; } @@ -75,7 +76,7 @@ public class DelimitedAllowShortAndLongTest extends AbstractJUnit4SpringContextT DataSetList data = exchange.getIn().getBody(DataSetList.class); int counter = 0; for (Map<String, Object> map : data) { - assertEquals("ITEM_DESC", expectedItemDescriptions[counter], map.get("ITEM_DESC")); + assertEquals(expectedItemDescriptions[counter], map.get("ITEM_DESC"), "ITEM_DESC"); counter++; } } @@ -89,7 +90,7 @@ public class DelimitedAllowShortAndLongTest extends AbstractJUnit4SpringContextT DataSetList data = exchange.getIn().getBody(DataSetList.class); int counter = 0; for (Map<String, Object> map : data) { - assertEquals("ITEM_DESC", expectedItemDescriptions[counter], map.get("ITEM_DESC")); + assertEquals(expectedItemDescriptions[counter], map.get("ITEM_DESC"), "ITEM_DESC"); counter++; } } diff --git a/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/DelimitedAllowShortTest.java b/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/DelimitedAllowShortTest.java index b959b21..5b253b6 100644 --- a/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/DelimitedAllowShortTest.java +++ b/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/DelimitedAllowShortTest.java @@ -23,18 +23,19 @@ import org.apache.camel.EndpointInject; import org.apache.camel.Exchange; import org.apache.camel.Message; import org.apache.camel.component.mock.MockEndpoint; +import org.apache.camel.test.spring.junit5.CamelSpringTest; import org.apache.camel.util.ObjectHelper; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +@CamelSpringTest @ContextConfiguration -public class DelimitedAllowShortTest extends AbstractJUnit4SpringContextTests { +public class DelimitedAllowShortTest { private static final Logger LOG = LoggerFactory.getLogger(DelimitedAllowShortTest.class); @EndpointInject("mock:results") @@ -57,10 +58,10 @@ public class DelimitedAllowShortTest extends AbstractJUnit4SpringContextTests { List<Exchange> list = results.getReceivedExchanges(); for (Exchange exchange : list) { Message in = exchange.getIn(); - assertEquals("counter", in.getHeader("camelFlatpackCounter"), counter); + assertEquals(in.getHeader("camelFlatpackCounter"), counter, "counter"); Map<?, ?> body = in.getBody(Map.class); - assertNotNull("Should have found body as a Map but was: " + ObjectHelper.className(in.getBody()), body); - assertEquals("ITEM_DESC", expectedItemDescriptions[counter], body.get("ITEM_DESC")); + assertNotNull(body, "Should have found body as a Map but was: " + ObjectHelper.className(in.getBody())); + assertEquals(expectedItemDescriptions[counter], body.get("ITEM_DESC"), "ITEM_DESC"); LOG.info("Result: " + counter + " = " + body); counter++; } @@ -75,7 +76,7 @@ public class DelimitedAllowShortTest extends AbstractJUnit4SpringContextTests { DataSetList data = exchange.getIn().getBody(DataSetList.class); int counter = 0; for (Map<String, Object> map : data) { - assertEquals("ITEM_DESC", expectedItemDescriptions[counter], map.get("ITEM_DESC")); + assertEquals(expectedItemDescriptions[counter], map.get("ITEM_DESC"), "ITEM_DESC"); counter++; } } @@ -89,7 +90,7 @@ public class DelimitedAllowShortTest extends AbstractJUnit4SpringContextTests { DataSetList data = exchange.getIn().getBody(DataSetList.class); int counter = 0; for (Map<String, Object> map : data) { - assertEquals("ITEM_DESC", expectedItemDescriptions[counter], map.get("ITEM_DESC")); + assertEquals(expectedItemDescriptions[counter], map.get("ITEM_DESC"), "ITEM_DESC"); counter++; } } diff --git a/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/DelimitedErrorWithUnmarshalTest.java b/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/DelimitedErrorWithUnmarshalTest.java index df89b7b..5996e59 100644 --- a/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/DelimitedErrorWithUnmarshalTest.java +++ b/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/DelimitedErrorWithUnmarshalTest.java @@ -19,15 +19,16 @@ package org.apache.camel.component.flatpack; import net.sf.flatpack.DataSet; import org.apache.camel.EndpointInject; import org.apache.camel.component.mock.MockEndpoint; -import org.junit.Test; +import org.apache.camel.test.spring.junit5.CamelSpringTest; +import org.junit.jupiter.api.Test; import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +@CamelSpringTest @ContextConfiguration -public class DelimitedErrorWithUnmarshalTest extends AbstractJUnit4SpringContextTests { +public class DelimitedErrorWithUnmarshalTest { @EndpointInject("mock:results") protected MockEndpoint results; diff --git a/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/DelimitedTest.java b/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/DelimitedTest.java index b902c4c..4a40f03 100644 --- a/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/DelimitedTest.java +++ b/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/DelimitedTest.java @@ -23,18 +23,19 @@ import org.apache.camel.EndpointInject; import org.apache.camel.Exchange; import org.apache.camel.Message; import org.apache.camel.component.mock.MockEndpoint; +import org.apache.camel.test.spring.junit5.CamelSpringTest; import org.apache.camel.util.ObjectHelper; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +@CamelSpringTest @ContextConfiguration -public class DelimitedTest extends AbstractJUnit4SpringContextTests { +public class DelimitedTest { private static final Logger LOG = LoggerFactory.getLogger(FixedLengthTest.class); @EndpointInject("mock:results") @@ -52,8 +53,8 @@ public class DelimitedTest extends AbstractJUnit4SpringContextTests { for (Exchange exchange : list) { Message in = exchange.getIn(); Map<?, ?> body = in.getBody(Map.class); - assertNotNull("Should have found body as a Map but was: " + ObjectHelper.className(in.getBody()), body); - assertEquals("ITEM_DESC", expectedItemDesc[counter], body.get("ITEM_DESC")); + assertNotNull(body, "Should have found body as a Map but was: " + ObjectHelper.className(in.getBody())); + assertEquals(expectedItemDesc[counter], body.get("ITEM_DESC"), "ITEM_DESC"); LOG.info("Result: " + counter + " = " + body); counter++; } diff --git a/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/DelimitedWithNoDescriptorTest.java b/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/DelimitedWithNoDescriptorTest.java index fd4288d..0abc939 100644 --- a/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/DelimitedWithNoDescriptorTest.java +++ b/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/DelimitedWithNoDescriptorTest.java @@ -23,18 +23,19 @@ import org.apache.camel.EndpointInject; import org.apache.camel.Exchange; import org.apache.camel.Message; import org.apache.camel.component.mock.MockEndpoint; +import org.apache.camel.test.spring.junit5.CamelSpringTest; import org.apache.camel.util.ObjectHelper; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +@CamelSpringTest @ContextConfiguration -public class DelimitedWithNoDescriptorTest extends AbstractJUnit4SpringContextTests { +public class DelimitedWithNoDescriptorTest { private static final Logger LOG = LoggerFactory.getLogger(FixedLengthTest.class); @EndpointInject("mock:results") @@ -52,8 +53,8 @@ public class DelimitedWithNoDescriptorTest extends AbstractJUnit4SpringContextTe for (Exchange exchange : list) { Message in = exchange.getIn(); Map<?, ?> body = in.getBody(Map.class); - assertNotNull("Should have found body as a Map but was: " + ObjectHelper.className(in.getBody()), body); - assertEquals("NAME", expectedItemDesc[counter], body.get("NAME")); + assertNotNull(body, "Should have found body as a Map but was: " + ObjectHelper.className(in.getBody())); + assertEquals(expectedItemDesc[counter], body.get("NAME"), "NAME"); LOG.info("Result: " + counter + " = " + body); counter++; } diff --git a/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/DelimitedWithUnmarshalTest.java b/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/DelimitedWithUnmarshalTest.java index b072d9e..de7991f 100644 --- a/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/DelimitedWithUnmarshalTest.java +++ b/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/DelimitedWithUnmarshalTest.java @@ -23,18 +23,19 @@ import org.apache.camel.EndpointInject; import org.apache.camel.Exchange; import org.apache.camel.Message; import org.apache.camel.component.mock.MockEndpoint; +import org.apache.camel.test.spring.junit5.CamelSpringTest; import org.apache.camel.util.ObjectHelper; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +@CamelSpringTest @ContextConfiguration -public class DelimitedWithUnmarshalTest extends AbstractJUnit4SpringContextTests { +public class DelimitedWithUnmarshalTest { private static final Logger LOG = LoggerFactory.getLogger(FixedLengthTest.class); @EndpointInject("mock:results") @@ -52,8 +53,8 @@ public class DelimitedWithUnmarshalTest extends AbstractJUnit4SpringContextTests for (Exchange exchange : list) { Message in = exchange.getIn(); Map<?, ?> body = in.getBody(Map.class); - assertNotNull("Should have found body as a Map but was: " + ObjectHelper.className(in.getBody()), body); - assertEquals("ITEM_DESC result(" + counter + ")", expectedItemDesc[counter], body.get("ITEM_DESC")); + assertNotNull(body, "Should have found body as a Map but was: " + ObjectHelper.className(in.getBody())); + assertEquals(expectedItemDesc[counter], body.get("ITEM_DESC"), "ITEM_DESC result(" + counter + ")"); LOG.info("Result: " + counter + " = " + body); counter++; } diff --git a/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FixedLengthAllowLongTest.java b/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FixedLengthAllowLongTest.java index 3a701f3..49288b1 100644 --- a/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FixedLengthAllowLongTest.java +++ b/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FixedLengthAllowLongTest.java @@ -23,18 +23,19 @@ import org.apache.camel.EndpointInject; import org.apache.camel.Exchange; import org.apache.camel.Message; import org.apache.camel.component.mock.MockEndpoint; +import org.apache.camel.test.spring.junit5.CamelSpringTest; import org.apache.camel.util.ObjectHelper; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +@CamelSpringTest @ContextConfiguration -public class FixedLengthAllowLongTest extends AbstractJUnit4SpringContextTests { +public class FixedLengthAllowLongTest { private static final Logger LOG = LoggerFactory.getLogger(FixedLengthAllowLongTest.class); @EndpointInject("mock:results") @@ -57,10 +58,10 @@ public class FixedLengthAllowLongTest extends AbstractJUnit4SpringContextTests { List<Exchange> list = results.getReceivedExchanges(); for (Exchange exchange : list) { Message in = exchange.getIn(); - assertEquals("counter", in.getHeader("camelFlatpackCounter"), counter); + assertEquals(in.getHeader("camelFlatpackCounter"), counter, "counter"); Map<?, ?> body = in.getBody(Map.class); - assertNotNull("Should have found body as a Map but was: " + ObjectHelper.className(in.getBody()), body); - assertEquals("FIRSTNAME", expectedFirstName[counter], body.get("FIRSTNAME")); + assertNotNull(body, "Should have found body as a Map but was: " + ObjectHelper.className(in.getBody())); + assertEquals(expectedFirstName[counter], body.get("FIRSTNAME"), "FIRSTNAME"); LOG.info("Result: " + counter + " = " + body); counter++; } @@ -75,7 +76,7 @@ public class FixedLengthAllowLongTest extends AbstractJUnit4SpringContextTests { DataSetList data = exchange.getIn().getBody(DataSetList.class); int counter = 0; for (Map<String, Object> map : data) { - assertEquals("FIRSTNAME", expectedFirstName[counter], map.get("FIRSTNAME")); + assertEquals(expectedFirstName[counter], map.get("FIRSTNAME"), "FIRSTNAME"); counter++; } } @@ -89,7 +90,7 @@ public class FixedLengthAllowLongTest extends AbstractJUnit4SpringContextTests { DataSetList data = exchange.getIn().getBody(DataSetList.class); int counter = 0; for (Map<String, Object> map : data) { - assertEquals("FIRSTNAME", expectedFirstName[counter], map.get("FIRSTNAME")); + assertEquals(expectedFirstName[counter], map.get("FIRSTNAME"), "FIRSTNAME"); counter++; } } diff --git a/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FixedLengthAllowShortAndLongTest.java b/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FixedLengthAllowShortAndLongTest.java index 180249e..f869e63 100644 --- a/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FixedLengthAllowShortAndLongTest.java +++ b/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FixedLengthAllowShortAndLongTest.java @@ -23,18 +23,19 @@ import org.apache.camel.EndpointInject; import org.apache.camel.Exchange; import org.apache.camel.Message; import org.apache.camel.component.mock.MockEndpoint; +import org.apache.camel.test.spring.junit5.CamelSpringTest; import org.apache.camel.util.ObjectHelper; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +@CamelSpringTest @ContextConfiguration -public class FixedLengthAllowShortAndLongTest extends AbstractJUnit4SpringContextTests { +public class FixedLengthAllowShortAndLongTest { private static final Logger LOG = LoggerFactory.getLogger(FixedLengthAllowShortAndLongTest.class); @EndpointInject("mock:results") @@ -57,10 +58,10 @@ public class FixedLengthAllowShortAndLongTest extends AbstractJUnit4SpringContex List<Exchange> list = results.getReceivedExchanges(); for (Exchange exchange : list) { Message in = exchange.getIn(); - assertEquals("counter", in.getHeader("camelFlatpackCounter"), counter); + assertEquals(in.getHeader("camelFlatpackCounter"), counter, "counter"); Map<?, ?> body = in.getBody(Map.class); - assertNotNull("Should have found body as a Map but was: " + ObjectHelper.className(in.getBody()), body); - assertEquals("FIRSTNAME", expectedFirstName[counter], body.get("FIRSTNAME")); + assertNotNull(body, "Should have found body as a Map but was: " + ObjectHelper.className(in.getBody())); + assertEquals(expectedFirstName[counter], body.get("FIRSTNAME"), "FIRSTNAME"); LOG.info("Result: " + counter + " = " + body); counter++; } @@ -75,7 +76,7 @@ public class FixedLengthAllowShortAndLongTest extends AbstractJUnit4SpringContex DataSetList data = exchange.getIn().getBody(DataSetList.class); int counter = 0; for (Map<String, Object> map : data) { - assertEquals("FIRSTNAME", expectedFirstName[counter], map.get("FIRSTNAME")); + assertEquals(expectedFirstName[counter], map.get("FIRSTNAME"), "FIRSTNAME"); counter++; } } @@ -89,7 +90,7 @@ public class FixedLengthAllowShortAndLongTest extends AbstractJUnit4SpringContex DataSetList data = exchange.getIn().getBody(DataSetList.class); int counter = 0; for (Map<String, Object> map : data) { - assertEquals("FIRSTNAME", expectedFirstName[counter], map.get("FIRSTNAME")); + assertEquals(expectedFirstName[counter], map.get("FIRSTNAME"), "FIRSTNAME"); counter++; } } diff --git a/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FixedLengthAllowShortTest.java b/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FixedLengthAllowShortTest.java index f66751e..0c9dd81 100644 --- a/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FixedLengthAllowShortTest.java +++ b/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FixedLengthAllowShortTest.java @@ -23,18 +23,19 @@ import org.apache.camel.EndpointInject; import org.apache.camel.Exchange; import org.apache.camel.Message; import org.apache.camel.component.mock.MockEndpoint; +import org.apache.camel.test.spring.junit5.CamelSpringTest; import org.apache.camel.util.ObjectHelper; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +@CamelSpringTest @ContextConfiguration -public class FixedLengthAllowShortTest extends AbstractJUnit4SpringContextTests { +public class FixedLengthAllowShortTest { private static final Logger LOG = LoggerFactory.getLogger(FixedLengthAllowShortTest.class); @EndpointInject("mock:results") @@ -57,10 +58,10 @@ public class FixedLengthAllowShortTest extends AbstractJUnit4SpringContextTests List<Exchange> list = results.getReceivedExchanges(); for (Exchange exchange : list) { Message in = exchange.getIn(); - assertEquals("counter", in.getHeader("camelFlatpackCounter"), counter); + assertEquals(in.getHeader("camelFlatpackCounter"), counter, "counter"); Map<?, ?> body = in.getBody(Map.class); - assertNotNull("Should have found body as a Map but was: " + ObjectHelper.className(in.getBody()), body); - assertEquals("FIRSTNAME", expectedFirstName[counter], body.get("FIRSTNAME")); + assertNotNull(body, "Should have found body as a Map but was: " + ObjectHelper.className(in.getBody())); + assertEquals(expectedFirstName[counter], body.get("FIRSTNAME"), "FIRSTNAME"); LOG.info("Result: " + counter + " = " + body); counter++; } @@ -75,7 +76,7 @@ public class FixedLengthAllowShortTest extends AbstractJUnit4SpringContextTests DataSetList data = exchange.getIn().getBody(DataSetList.class); int counter = 0; for (Map<String, Object> map : data) { - assertEquals("FIRSTNAME", expectedFirstName[counter], map.get("FIRSTNAME")); + assertEquals(expectedFirstName[counter], map.get("FIRSTNAME"), "FIRSTNAME"); counter++; } } @@ -89,7 +90,7 @@ public class FixedLengthAllowShortTest extends AbstractJUnit4SpringContextTests DataSetList data = exchange.getIn().getBody(DataSetList.class); int counter = 0; for (Map<String, Object> map : data) { - assertEquals("FIRSTNAME", expectedFirstName[counter], map.get("FIRSTNAME")); + assertEquals(expectedFirstName[counter], map.get("FIRSTNAME"), "FIRSTNAME"); counter++; } } diff --git a/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FixedLengthTest.java b/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FixedLengthTest.java index e3e1dca..f52aebe 100644 --- a/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FixedLengthTest.java +++ b/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FixedLengthTest.java @@ -23,18 +23,19 @@ import org.apache.camel.EndpointInject; import org.apache.camel.Exchange; import org.apache.camel.Message; import org.apache.camel.component.mock.MockEndpoint; +import org.apache.camel.test.spring.junit5.CamelSpringTest; import org.apache.camel.util.ObjectHelper; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +@CamelSpringTest @ContextConfiguration -public class FixedLengthTest extends AbstractJUnit4SpringContextTests { +public class FixedLengthTest { private static final Logger LOG = LoggerFactory.getLogger(FixedLengthTest.class); @EndpointInject("mock:results") @@ -51,10 +52,10 @@ public class FixedLengthTest extends AbstractJUnit4SpringContextTests { List<Exchange> list = results.getReceivedExchanges(); for (Exchange exchange : list) { Message in = exchange.getIn(); - assertEquals("counter", in.getHeader("camelFlatpackCounter"), counter); + assertEquals(in.getHeader("camelFlatpackCounter"), counter, "counter"); Map<?, ?> body = in.getBody(Map.class); - assertNotNull("Should have found body as a Map but was: " + ObjectHelper.className(in.getBody()), body); - assertEquals("FIRSTNAME", expectedFirstName[counter], body.get("FIRSTNAME")); + assertNotNull(body, "Should have found body as a Map but was: " + ObjectHelper.className(in.getBody())); + assertEquals(expectedFirstName[counter], body.get("FIRSTNAME"), "FIRSTNAME"); LOG.info("Result: " + counter + " = " + body); counter++; } diff --git a/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FixedLengthWithUnmarshalTest.java b/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FixedLengthWithUnmarshalTest.java index 0bd3383..86543c0 100644 --- a/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FixedLengthWithUnmarshalTest.java +++ b/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FixedLengthWithUnmarshalTest.java @@ -23,18 +23,19 @@ import org.apache.camel.EndpointInject; import org.apache.camel.Exchange; import org.apache.camel.Message; import org.apache.camel.component.mock.MockEndpoint; +import org.apache.camel.test.spring.junit5.CamelSpringTest; import org.apache.camel.util.ObjectHelper; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +@CamelSpringTest @ContextConfiguration -public class FixedLengthWithUnmarshalTest extends AbstractJUnit4SpringContextTests { +public class FixedLengthWithUnmarshalTest { private static final Logger LOG = LoggerFactory.getLogger(FixedLengthTest.class); @EndpointInject("mock:results") @@ -52,8 +53,8 @@ public class FixedLengthWithUnmarshalTest extends AbstractJUnit4SpringContextTes for (Exchange exchange : list) { Message in = exchange.getIn(); Map<?, ?> body = in.getBody(Map.class); - assertNotNull("Should have found body as a Map but was: " + ObjectHelper.className(in.getBody()), body); - assertEquals("FIRSTNAME", expectedFirstName[counter], body.get("FIRSTNAME")); + assertNotNull(body, "Should have found body as a Map but was: " + ObjectHelper.className(in.getBody())); + assertEquals(expectedFirstName[counter], body.get("FIRSTNAME"), "FIRSTNAME"); LOG.info("Result: " + counter + " = " + body); counter++; } diff --git a/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FlatpackDelimitedDataFormatTest.java b/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FlatpackDelimitedDataFormatTest.java index 75e9f82..e1bd3d1 100644 --- a/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FlatpackDelimitedDataFormatTest.java +++ b/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FlatpackDelimitedDataFormatTest.java @@ -26,8 +26,10 @@ import org.apache.camel.builder.RouteBuilder; import org.apache.camel.component.mock.MockEndpoint; import org.apache.camel.converter.IOConverter; import org.apache.camel.dataformat.flatpack.FlatpackDataFormat; -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; /** * Unit test for delimited DataFormat. diff --git a/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FlatpackFixedLengthDataFormatTest.java b/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FlatpackFixedLengthDataFormatTest.java index 3a85c0b..43f4ce5 100644 --- a/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FlatpackFixedLengthDataFormatTest.java +++ b/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FlatpackFixedLengthDataFormatTest.java @@ -26,8 +26,11 @@ import org.apache.camel.builder.RouteBuilder; import org.apache.camel.component.mock.MockEndpoint; import org.apache.camel.converter.IOConverter; import org.apache.camel.dataformat.flatpack.FlatpackDataFormat; -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; +import static org.junit.jupiter.api.Assertions.assertTrue; /** * Unit test for fixed length DataFormat. diff --git a/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FlatpackFixedLengthWithHeaderAndTrailerDataFormatTest.java b/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FlatpackFixedLengthWithHeaderAndTrailerDataFormatTest.java index 2a90869..c57e34d 100644 --- a/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FlatpackFixedLengthWithHeaderAndTrailerDataFormatTest.java +++ b/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FlatpackFixedLengthWithHeaderAndTrailerDataFormatTest.java @@ -23,8 +23,10 @@ import org.apache.camel.builder.RouteBuilder; import org.apache.camel.component.mock.MockEndpoint; import org.apache.camel.converter.IOConverter; import org.apache.camel.dataformat.flatpack.FlatpackDataFormat; -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; /** * Unit test for fixed length DataFormat. diff --git a/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/HeaderAndTrailerTest.java b/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/HeaderAndTrailerTest.java index cd7140a..124c06b 100644 --- a/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/HeaderAndTrailerTest.java +++ b/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/HeaderAndTrailerTest.java @@ -23,18 +23,19 @@ import org.apache.camel.EndpointInject; import org.apache.camel.Exchange; import org.apache.camel.Message; import org.apache.camel.component.mock.MockEndpoint; +import org.apache.camel.test.spring.junit5.CamelSpringTest; import org.apache.camel.util.ObjectHelper; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +@CamelSpringTest @ContextConfiguration -public class HeaderAndTrailerTest extends AbstractJUnit4SpringContextTests { +public class HeaderAndTrailerTest { private static final Logger LOG = LoggerFactory.getLogger(HeaderAndTrailerTest.class); @EndpointInject("mock:results") @@ -59,8 +60,8 @@ public class HeaderAndTrailerTest extends AbstractJUnit4SpringContextTests { for (Exchange exchange : list.subList(1, 5)) { Message in = exchange.getIn(); Map<?, ?> body = in.getBody(Map.class); - assertNotNull("Should have found body as a Map but was: " + ObjectHelper.className(in.getBody()), body); - assertEquals("FIRSTNAME", expectedFirstName[counter], body.get("FIRSTNAME")); + assertNotNull(body, "Should have found body as a Map but was: " + ObjectHelper.className(in.getBody())); + assertEquals(expectedFirstName[counter], body.get("FIRSTNAME"), "FIRSTNAME"); LOG.info("Result: " + counter + " = " + body); counter++; } diff --git a/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/InvalidFixedLengthTest.java b/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/InvalidFixedLengthTest.java index 298e14a..622e14b 100644 --- a/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/InvalidFixedLengthTest.java +++ b/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/InvalidFixedLengthTest.java @@ -19,13 +19,14 @@ package org.apache.camel.component.flatpack; import org.apache.camel.EndpointInject; import org.apache.camel.Exchange; import org.apache.camel.component.mock.MockEndpoint; -import org.junit.Test; +import org.apache.camel.test.spring.junit5.CamelSpringTest; +import org.junit.jupiter.api.Test; import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests; import org.springframework.util.Assert; +@CamelSpringTest @ContextConfiguration -public class InvalidFixedLengthTest extends AbstractJUnit4SpringContextTests { +public class InvalidFixedLengthTest { @EndpointInject("mock:results") protected MockEndpoint results; diff --git a/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/NoSplitRowsTest.java b/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/NoSplitRowsTest.java index 2d5a719..9a2a2ec 100644 --- a/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/NoSplitRowsTest.java +++ b/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/NoSplitRowsTest.java @@ -21,20 +21,21 @@ import java.util.Map; import org.apache.camel.EndpointInject; import org.apache.camel.component.mock.MockEndpoint; +import org.apache.camel.test.spring.junit5.CamelSpringTest; import org.apache.camel.util.CastUtils; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; /** * Unit test to verify that splitRows=false option. */ +@CamelSpringTest @ContextConfiguration -public class NoSplitRowsTest extends AbstractJUnit4SpringContextTests { +public class NoSplitRowsTest { private static final Logger LOG = LoggerFactory.getLogger(NoSplitRowsTest.class); @@ -61,7 +62,7 @@ public class NoSplitRowsTest extends AbstractJUnit4SpringContextTests { // assert body int counter = 0; for (Map<String, String> row : data.subList(1, 5)) { - assertEquals("FIRSTNAME", expectedFirstName[counter], row.get("FIRSTNAME")); + assertEquals(expectedFirstName[counter], row.get("FIRSTNAME"), "FIRSTNAME"); LOG.info("Result: " + counter + " = " + row); counter++; } diff --git a/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/StreamedSplitTest.java b/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/StreamedSplitTest.java index 01a9251..55a2abf 100644 --- a/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/StreamedSplitTest.java +++ b/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/StreamedSplitTest.java @@ -23,18 +23,19 @@ import org.apache.camel.EndpointInject; import org.apache.camel.Exchange; import org.apache.camel.Message; import org.apache.camel.component.mock.MockEndpoint; +import org.apache.camel.test.spring.junit5.CamelSpringTest; import org.apache.camel.util.ObjectHelper; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +@CamelSpringTest @ContextConfiguration -public class StreamedSplitTest extends AbstractJUnit4SpringContextTests { +public class StreamedSplitTest { private static final Logger LOG = LoggerFactory.getLogger(FixedLengthTest.class); @EndpointInject("mock:results") @@ -52,8 +53,8 @@ public class StreamedSplitTest extends AbstractJUnit4SpringContextTests { for (Exchange exchange : list) { Message in = exchange.getIn(); Map<?, ?> body = in.getBody(Map.class); - assertNotNull("Should have found body as a Map but was: " + ObjectHelper.className(in.getBody()), body); - assertEquals("NAME", expectedItemDesc[counter], body.get("NAME")); + assertNotNull(body, "Should have found body as a Map but was: " + ObjectHelper.className(in.getBody())); + assertEquals(expectedItemDesc[counter], body.get("NAME"), "NAME"); LOG.info("Result: " + counter + " = " + body); counter++; } diff --git a/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/XMLNoSplitRowsTest.java b/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/XMLNoSplitRowsTest.java index 01cb7d1..ce970de 100644 --- a/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/XMLNoSplitRowsTest.java +++ b/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/XMLNoSplitRowsTest.java @@ -22,21 +22,22 @@ import org.w3c.dom.NodeList; import org.apache.camel.EndpointInject; import org.apache.camel.component.mock.MockEndpoint; -import org.junit.Test; +import org.apache.camel.test.spring.junit5.CamelSpringTest; +import org.junit.jupiter.api.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; /** * Unit test to verify that splitRows=false option works with XML Conversion. */ +@CamelSpringTest @ContextConfiguration -public class XMLNoSplitRowsTest extends AbstractJUnit4SpringContextTests { +public class XMLNoSplitRowsTest { private static final Logger LOG = LoggerFactory.getLogger(XMLNoSplitRowsTest.class); diff --git a/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/XMLSplitRowsTest.java b/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/XMLSplitRowsTest.java index ececf0d..0e3f69d 100644 --- a/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/XMLSplitRowsTest.java +++ b/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/XMLSplitRowsTest.java @@ -26,21 +26,22 @@ import org.apache.camel.EndpointInject; import org.apache.camel.Exchange; import org.apache.camel.Message; import org.apache.camel.component.mock.MockEndpoint; -import org.junit.Test; +import org.apache.camel.test.spring.junit5.CamelSpringTest; +import org.junit.jupiter.api.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; /** * Unit test to verify that splitRows=true option works with XML Conversion. */ +@CamelSpringTest @ContextConfiguration -public class XMLSplitRowsTest extends AbstractJUnit4SpringContextTests { +public class XMLSplitRowsTest { private static final Logger LOG = LoggerFactory.getLogger(XMLSplitRowsTest.class); @EndpointInject("mock:results")
