This is an automated email from the ASF dual-hosted git repository. aldettinger pushed a commit to branch CAMEL-13342-JUNIT5-EXPLORATORY in repository https://gitbox.apache.org/repos/asf/camel.git
commit 98f221bb8ba90205dcfcb5b124d944c8debfe52d Author: aldettinger <aldettin...@gmail.com> AuthorDate: Tue Jul 16 18:04:00 2019 +0200 CAMEL-13342: Moved further the proof-of-concept for camel-test-spring/CamelSpringTestSupport --- components/camel-csv/pom.xml | 12 +- .../csv/CsvDataFormatCustomFactoryTest.java | 12 +- .../CsvDataFormatCustomRecordConverterTest.java | 7 +- .../csv/CsvDataFormatResourceFactoryTest.java | 12 +- .../camel/dataformat/csv/CsvDataFormatTest.java | 16 +-- ...svMarshalAutogenColumnsSpringQuoteModeTest.java | 6 +- .../csv/CsvMarshalAutogenColumnsSpringTest.java | 6 +- .../dataformat/csv/CsvMarshalCharsetTest.java | 5 +- .../camel/dataformat/csv/CsvMarshalHeaderTest.java | 16 +-- ...MarshalHeaderWithCustomMarshallFactoryTest.java | 16 +-- .../csv/CsvMarshalPipeDelimiterSpringTest.java | 6 +- .../csv/CsvMarshalPipeDelimiterTest.java | 6 +- .../camel/dataformat/csv/CsvMarshalTest.java | 6 +- .../dataformat/csv/CsvRecordConvertersTest.java | 10 +- .../camel/dataformat/csv/CsvRouteCharsetTest.java | 6 +- .../apache/camel/dataformat/csv/CsvRouteTest.java | 29 +++-- .../csv/CsvUnmarshalMapLineSpringTest.java | 6 +- .../csv/CsvUnmarshalPipeDelimiterSpringTest.java | 6 +- .../csv/CsvUnmarshalPipeDelimiterTest.java | 6 +- .../csv/CsvUnmarshalSkipFirstLineSpringTest.java | 6 +- .../csv/CsvUnmarshalStreamSpringTest.java | 6 +- .../dataformat/csv/CsvUnmarshalStreamTest.java | 6 +- .../csv/CsvUnmarshalTabDelimiterSpringTest.java | 6 +- .../csv/CsvUnmarshalTabDelimiterTest.java | 6 +- .../camel/dataformat/csv/CsvUnmarshalTest.java | 5 +- ...CsvUnmarshalTwoCsvDataFormatConcurrentTest.java | 6 +- .../spring/CamelSpringBootJUnit4ClassRunner.java | 33 ----- .../CamelSpringDelegatingTestContextLoader.java | 138 --------------------- .../spring/CamelSpringTestContextLoader.java | 1 - .../test/junit5/spring/CamelSpringTestSupport.java | 1 - .../junit5/spring/RouteCoverageEventNotifier.java | 1 - ...nterceptSendToEndpointWithLoadbalancerTest.java | 4 +- .../test/issues/AdviceWithOnCompletionTest.java | 4 +- .../AdviceWithOnExceptionMultipleIssueTest.java | 4 +- .../test/issues/MockEndpointsAndSkipTest.java | 4 +- 35 files changed, 146 insertions(+), 274 deletions(-) diff --git a/components/camel-csv/pom.xml b/components/camel-csv/pom.xml index 05f2a94..ffd4ece 100644 --- a/components/camel-csv/pom.xml +++ b/components/camel-csv/pom.xml @@ -55,6 +55,13 @@ <dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-test-spring</artifactId> + <exclusions> + <!-- proof that junit is no more needed once tests have been migrated --> + <exclusion> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + </exclusion> + </exclusions> <scope>test</scope> </dependency> <dependency> @@ -73,8 +80,9 @@ <scope>test</scope> </dependency> <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> + <groupId>org.hamcrest</groupId> + <artifactId>hamcrest-core</artifactId> + <version>2.1</version> <scope>test</scope> </dependency> </dependencies> diff --git a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvDataFormatCustomFactoryTest.java b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvDataFormatCustomFactoryTest.java index 89c29eb..733deea 100644 --- a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvDataFormatCustomFactoryTest.java +++ b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvDataFormatCustomFactoryTest.java @@ -20,9 +20,9 @@ import java.util.Arrays; import java.util.List; import org.apache.camel.component.mock.MockEndpoint; -import org.apache.camel.test.spring.CamelSpringTestSupport; -import org.junit.Assert; -import org.junit.Test; +import org.apache.camel.test.junit5.spring.CamelSpringTestSupport; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; import org.springframework.context.support.ClassPathXmlApplicationContext; public class CsvDataFormatCustomFactoryTest extends CamelSpringTestSupport { @@ -38,9 +38,9 @@ public class CsvDataFormatCustomFactoryTest extends CamelSpringTestSupport { String body = mock.getReceivedExchanges().get(0).getIn().getBody(String.class); String[] lines = body.split("\r\n"); - Assert.assertEquals(2, lines.length); - Assert.assertEquals("A1:B1:C1", lines[0].trim()); - Assert.assertEquals("A2:B2:C2", lines[1].trim()); + Assertions.assertEquals(2, lines.length); + Assertions.assertEquals("A1:B1:C1", lines[0].trim()); + Assertions.assertEquals("A2:B2:C2", lines[1].trim()); } private List<List<String>> getData() { diff --git a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvDataFormatCustomRecordConverterTest.java b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvDataFormatCustomRecordConverterTest.java index 5c80dde..3874828 100644 --- a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvDataFormatCustomRecordConverterTest.java +++ b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvDataFormatCustomRecordConverterTest.java @@ -22,11 +22,14 @@ import java.util.stream.Stream; import org.apache.camel.Message; import org.apache.camel.component.mock.MockEndpoint; -import org.apache.camel.test.spring.CamelSpringTestSupport; +import org.apache.camel.test.junit5.spring.CamelSpringTestSupport; import org.apache.camel.util.CastUtils; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.context.support.ClassPathXmlApplicationContext; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; + /** * Test cases for {@link CsvRecordConverter}. */ diff --git a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvDataFormatResourceFactoryTest.java b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvDataFormatResourceFactoryTest.java index c0cce86..0eea8f3 100644 --- a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvDataFormatResourceFactoryTest.java +++ b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvDataFormatResourceFactoryTest.java @@ -20,9 +20,9 @@ import java.util.Arrays; import java.util.List; import org.apache.camel.component.mock.MockEndpoint; -import org.apache.camel.test.spring.CamelSpringTestSupport; -import org.junit.Assert; -import org.junit.Test; +import org.apache.camel.test.junit5.spring.CamelSpringTestSupport; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; import org.springframework.context.support.ClassPathXmlApplicationContext; public class CsvDataFormatResourceFactoryTest extends CamelSpringTestSupport { @@ -38,9 +38,9 @@ public class CsvDataFormatResourceFactoryTest extends CamelSpringTestSupport { String body = mock.getReceivedExchanges().get(0).getIn().getBody(String.class); String[] lines = body.split("\r\n"); - Assert.assertEquals(2, lines.length); - Assert.assertEquals("A1,B1,C1", lines[0].trim()); - Assert.assertEquals("A2,B2,C2", lines[1].trim()); + Assertions.assertEquals(2, lines.length); + Assertions.assertEquals("A1,B1,C1", lines[0].trim()); + Assertions.assertEquals("A2,B2,C2", lines[1].trim()); } private List<List<String>> getData() { diff --git a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvDataFormatTest.java b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvDataFormatTest.java index 3312a72..bf42048 100644 --- a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvDataFormatTest.java +++ b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvDataFormatTest.java @@ -19,14 +19,14 @@ package org.apache.camel.dataformat.csv; import org.apache.commons.csv.CSVFormat; import org.apache.commons.csv.CSVRecord; import org.apache.commons.csv.QuoteMode; -import org.junit.Test; - -import static org.junit.Assert.assertArrayEquals; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertSame; -import static org.junit.Assert.assertTrue; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertArrayEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; /** * This class tests the creation of the proper {@link org.apache.commons.csv.CSVFormat} based on the properties of diff --git a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalAutogenColumnsSpringQuoteModeTest.java b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalAutogenColumnsSpringQuoteModeTest.java index 0207696..07d6486 100644 --- a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalAutogenColumnsSpringQuoteModeTest.java +++ b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalAutogenColumnsSpringQuoteModeTest.java @@ -23,10 +23,12 @@ import java.util.Map; import org.apache.camel.EndpointInject; import org.apache.camel.component.mock.MockEndpoint; -import org.apache.camel.test.spring.CamelSpringTestSupport; -import org.junit.Test; +import org.apache.camel.test.junit5.spring.CamelSpringTestSupport; +import org.junit.jupiter.api.Test; import org.springframework.context.support.ClassPathXmlApplicationContext; +import static org.junit.jupiter.api.Assertions.assertEquals; + /** * Spring based integration test for the <code>CsvDataFormat</code> demonstrating the usage of * the <tt>autogenColumns</tt>, <tt>configRef</tt> and <tt>strategyRef</tt> options. diff --git a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalAutogenColumnsSpringTest.java b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalAutogenColumnsSpringTest.java index e7f870a..de0000e 100644 --- a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalAutogenColumnsSpringTest.java +++ b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalAutogenColumnsSpringTest.java @@ -23,10 +23,12 @@ import java.util.Map; import org.apache.camel.EndpointInject; import org.apache.camel.component.mock.MockEndpoint; -import org.apache.camel.test.spring.CamelSpringTestSupport; -import org.junit.Test; +import org.apache.camel.test.junit5.spring.CamelSpringTestSupport; +import org.junit.jupiter.api.Test; import org.springframework.context.support.ClassPathXmlApplicationContext; +import static org.junit.jupiter.api.Assertions.assertEquals; + /** * Spring based integration test for the <code>CsvDataFormat</code> demonstrating the usage of * the <tt>autogenColumns</tt>, <tt>configRef</tt> and <tt>strategyRef</tt> options. diff --git a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalCharsetTest.java b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalCharsetTest.java index 1e4a87e..871534c 100644 --- a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalCharsetTest.java +++ b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalCharsetTest.java @@ -22,9 +22,10 @@ import java.util.List; 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.Test; +import org.apache.camel.test.junit5.CamelTestSupport; +import org.junit.jupiter.api.Test; +import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.core.StringStartsWith.startsWith; public class CsvMarshalCharsetTest extends CamelTestSupport { diff --git a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalHeaderTest.java b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalHeaderTest.java index a5a4e92..04d60c2 100644 --- a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalHeaderTest.java +++ b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalHeaderTest.java @@ -19,6 +19,7 @@ package org.apache.camel.dataformat.csv; import java.io.File; import java.io.IOException; import java.nio.file.Files; +import java.nio.file.Path; import java.nio.file.Paths; import java.util.Arrays; import java.util.Collections; @@ -32,18 +33,19 @@ import org.apache.camel.Produce; import org.apache.camel.ProducerTemplate; import org.apache.camel.RoutesBuilder; import org.apache.camel.builder.RouteBuilder; -import org.apache.camel.test.junit4.CamelTestSupport; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.apache.camel.test.junit5.CamelTestSupport; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; + +import static org.junit.jupiter.api.Assertions.assertEquals; /** * <b>Camel</b> based test cases for {@link org.apache.camel.dataformat.csv.CsvDataFormat}. */ public class CsvMarshalHeaderTest extends CamelTestSupport { - @Rule - public TemporaryFolder folder = new TemporaryFolder(); + @TempDir + public Path folder; @Produce("direct:start") private ProducerTemplate producerTemplate; @@ -52,7 +54,7 @@ public class CsvMarshalHeaderTest extends CamelTestSupport { @Override protected void doPreSetup() throws Exception { - outputFile = new File(folder.newFolder(), "output.csv"); + outputFile = new File(folder.toFile(), "output.csv"); } @Test diff --git a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalHeaderWithCustomMarshallFactoryTest.java b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalHeaderWithCustomMarshallFactoryTest.java index a632fce..18e1fad 100644 --- a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalHeaderWithCustomMarshallFactoryTest.java +++ b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalHeaderWithCustomMarshallFactoryTest.java @@ -20,6 +20,7 @@ import java.io.File; import java.io.IOException; import java.io.OutputStream; import java.nio.file.Files; +import java.nio.file.Path; import java.nio.file.Paths; import java.util.ArrayList; import java.util.Arrays; @@ -36,20 +37,21 @@ import org.apache.camel.RoutesBuilder; import org.apache.camel.RuntimeCamelException; import org.apache.camel.builder.RouteBuilder; import org.apache.camel.support.ObjectHelper; -import org.apache.camel.test.junit4.CamelTestSupport; +import org.apache.camel.test.junit5.CamelTestSupport; import org.apache.commons.csv.CSVFormat; import org.apache.commons.csv.CSVPrinter; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; + +import static org.junit.jupiter.api.Assertions.assertEquals; /** * <b>Camel</b> based test cases for {@link CsvDataFormat}. */ public class CsvMarshalHeaderWithCustomMarshallFactoryTest extends CamelTestSupport { - @Rule - public TemporaryFolder folder = new TemporaryFolder(); + @TempDir + public Path folder; @Produce("direct:start") private ProducerTemplate producerTemplate; @@ -58,7 +60,7 @@ public class CsvMarshalHeaderWithCustomMarshallFactoryTest extends CamelTestSupp @Override protected void doPreSetup() throws Exception { - outputFile = new File(folder.newFolder(), "output.csv"); + outputFile = new File(folder.toFile(), "output.csv"); } @Test diff --git a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalPipeDelimiterSpringTest.java b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalPipeDelimiterSpringTest.java index 70204d8..449dd13 100644 --- a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalPipeDelimiterSpringTest.java +++ b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalPipeDelimiterSpringTest.java @@ -23,10 +23,12 @@ import java.util.Map; import org.apache.camel.EndpointInject; import org.apache.camel.component.mock.MockEndpoint; -import org.apache.camel.test.spring.CamelSpringTestSupport; -import org.junit.Test; +import org.apache.camel.test.junit5.spring.CamelSpringTestSupport; +import org.junit.jupiter.api.Test; import org.springframework.context.support.ClassPathXmlApplicationContext; +import static org.junit.jupiter.api.Assertions.assertEquals; + /** * Spring based integration test for the <code>CsvDataFormat</code> */ diff --git a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalPipeDelimiterTest.java b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalPipeDelimiterTest.java index 31f6015..5e75410 100644 --- a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalPipeDelimiterTest.java +++ b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalPipeDelimiterTest.java @@ -24,8 +24,10 @@ import java.util.Map; import org.apache.camel.EndpointInject; 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.assertEquals; public class CsvMarshalPipeDelimiterTest extends CamelTestSupport { diff --git a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalTest.java b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalTest.java index 613bc49..f474d13 100644 --- a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalTest.java +++ b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalTest.java @@ -23,8 +23,10 @@ import java.util.Map; import org.apache.camel.EndpointInject; 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.assertArrayEquals; /** * This class tests standard marshalling diff --git a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvRecordConvertersTest.java b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvRecordConvertersTest.java index 8b1d052..e7d385e 100644 --- a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvRecordConvertersTest.java +++ b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvRecordConvertersTest.java @@ -23,11 +23,11 @@ import java.util.Map; import org.apache.commons.csv.CSVFormat; import org.apache.commons.csv.CSVParser; import org.apache.commons.csv.CSVRecord; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; -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; /** * This class tests the common {@link CsvRecordConverter} implementations of @@ -36,7 +36,7 @@ import static org.junit.Assert.assertNotNull; public class CsvRecordConvertersTest { private CSVRecord record; - @Before + @BeforeEach public void setUp() throws Exception { CSVFormat format = CSVFormat.DEFAULT.withHeader("A", "B", "C"); CSVParser parser = new CSVParser(new StringReader("1,2,3"), format); diff --git a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvRouteCharsetTest.java b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvRouteCharsetTest.java index 9551b8a..38de54b 100644 --- a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvRouteCharsetTest.java +++ b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvRouteCharsetTest.java @@ -21,8 +21,10 @@ import java.util.List; 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.Test; +import org.apache.camel.test.junit5.CamelTestSupport; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; public class CsvRouteCharsetTest extends CamelTestSupport { diff --git a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvRouteTest.java b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvRouteTest.java index dcbaa22..f5c15f5 100644 --- a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvRouteTest.java +++ b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvRouteTest.java @@ -25,11 +25,15 @@ 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 org.slf4j.Logger; import org.slf4j.LoggerFactory; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + public class CsvRouteTest extends CamelTestSupport { private static final Logger LOG = LoggerFactory.getLogger(CsvRouteTest.class); @@ -52,12 +56,12 @@ public class CsvRouteTest extends CamelTestSupport { String text = in.getBody(String.class); log.debug("Received " + text); - assertNotNull("Should be able to convert received body to a string", text); + assertNotNull(text, "Should be able to convert received body to a string"); // order is not guaranteed with a Map (which was passed in before) // so we need to check for both combinations - assertTrue("Text body has wrong value.", "abc,123".equals(text.trim()) - || "123,abc".equals(text.trim())); + assertTrue("abc,123".equals(text.trim()) + || "123,abc".equals(text.trim()), "Text body has wrong value."); } } @@ -84,8 +88,7 @@ public class CsvRouteTest extends CamelTestSupport { String text1 = in1.getBody(String.class); log.debug("Received " + text1); - assertTrue("First CSV body has wrong value", - Pattern.matches("(abc,123)|(123,abc)", text1.trim())); + assertTrue(Pattern.matches("(abc,123)|(123,abc)", text1.trim()), "First CSV body has wrong value"); Message in2 = list.get(1).getIn(); String text2 = in2.getBody(String.class); @@ -94,11 +97,9 @@ public class CsvRouteTest extends CamelTestSupport { // fields should keep the same order from one call to the other if (text1.trim().equals("abc,123")) { - assertEquals("Second CSV body has wrong value", - "def,456,789", text2.trim()); + assertEquals("def,456,789", text2.trim(), "Second CSV body has wrong value"); } else { - assertEquals("Second CSV body has wrong value", - "456,def,789", text2.trim()); + assertEquals("456,def,789", text2.trim(), "Second CSV body has wrong value"); } } @@ -125,15 +126,13 @@ public class CsvRouteTest extends CamelTestSupport { String text1 = in1.getBody(String.class); log.debug("Received " + text1); - assertEquals("First CSV body has wrong value", - "abc;;123", text1.trim()); + assertEquals("abc;;123", text1.trim(), "First CSV body has wrong value"); Message in2 = list.get(1).getIn(); String text2 = in2.getBody(String.class); log.debug("Received " + text2); - assertEquals("Second CSV body has wrong value", - "def;789;456", text2.trim()); + assertEquals("def;789;456", text2.trim(), "Second CSV body has wrong value"); } diff --git a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalMapLineSpringTest.java b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalMapLineSpringTest.java index c917e9a..19e3f70 100644 --- a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalMapLineSpringTest.java +++ b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalMapLineSpringTest.java @@ -21,10 +21,12 @@ import java.util.Map; import org.apache.camel.EndpointInject; import org.apache.camel.component.mock.MockEndpoint; -import org.apache.camel.test.spring.CamelSpringTestSupport; -import org.junit.Test; +import org.apache.camel.test.junit5.spring.CamelSpringTestSupport; +import org.junit.jupiter.api.Test; import org.springframework.context.support.ClassPathXmlApplicationContext; +import static org.junit.jupiter.api.Assertions.assertEquals; + /** * Spring based test for the <code>CsvDataFormat</code> demonstrating the usage of * the <tt>useMaps</tt> option. diff --git a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalPipeDelimiterSpringTest.java b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalPipeDelimiterSpringTest.java index 1e3fe43..519e6a5 100644 --- a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalPipeDelimiterSpringTest.java +++ b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalPipeDelimiterSpringTest.java @@ -20,10 +20,12 @@ import java.util.List; import org.apache.camel.EndpointInject; import org.apache.camel.component.mock.MockEndpoint; -import org.apache.camel.test.spring.CamelSpringTestSupport; -import org.junit.Test; +import org.apache.camel.test.junit5.spring.CamelSpringTestSupport; +import org.junit.jupiter.api.Test; import org.springframework.context.support.ClassPathXmlApplicationContext; +import static org.junit.jupiter.api.Assertions.assertEquals; + /** * Spring based integration test for the <code>CsvDataFormat</code> */ diff --git a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalPipeDelimiterTest.java b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalPipeDelimiterTest.java index 9d32149..33a4653 100644 --- a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalPipeDelimiterTest.java +++ b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalPipeDelimiterTest.java @@ -21,8 +21,10 @@ import java.util.List; import org.apache.camel.EndpointInject; 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.assertEquals; /** * Spring based integration test for the <code>CsvDataFormat</code> diff --git a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalSkipFirstLineSpringTest.java b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalSkipFirstLineSpringTest.java index 6cb9a32..bbbb8c7 100644 --- a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalSkipFirstLineSpringTest.java +++ b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalSkipFirstLineSpringTest.java @@ -20,10 +20,12 @@ import java.util.List; import org.apache.camel.EndpointInject; import org.apache.camel.component.mock.MockEndpoint; -import org.apache.camel.test.spring.CamelSpringTestSupport; -import org.junit.Test; +import org.apache.camel.test.junit5.spring.CamelSpringTestSupport; +import org.junit.jupiter.api.Test; import org.springframework.context.support.ClassPathXmlApplicationContext; +import static org.junit.jupiter.api.Assertions.assertEquals; + /** * Spring based test for the <code>CsvDataFormat</code> demonstrating the usage of * the <tt>skipFirstLine</tt> option. diff --git a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalStreamSpringTest.java b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalStreamSpringTest.java index 05ee4e3..29fdd43 100644 --- a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalStreamSpringTest.java +++ b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalStreamSpringTest.java @@ -21,11 +21,13 @@ import java.util.List; import org.apache.camel.EndpointInject; import org.apache.camel.component.mock.MockEndpoint; -import org.apache.camel.test.spring.CamelSpringTestSupport; -import org.junit.Test; +import org.apache.camel.test.junit5.spring.CamelSpringTestSupport; +import org.junit.jupiter.api.Test; import org.springframework.context.support.AbstractApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; +import static org.junit.jupiter.api.Assertions.assertEquals; + public class CsvUnmarshalStreamSpringTest extends CamelSpringTestSupport { private static final String CSV_SAMPLE = "A,B,C\r1,2,3\rone,two,three"; diff --git a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalStreamTest.java b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalStreamTest.java index e476b7c..f745e66 100644 --- a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalStreamTest.java +++ b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalStreamTest.java @@ -25,8 +25,10 @@ import java.util.List; import org.apache.camel.EndpointInject; 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.assertEquals; /** * Spring based integration test for the <code>CsvDataFormat</code> diff --git a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalTabDelimiterSpringTest.java b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalTabDelimiterSpringTest.java index 61de960..1e971fc 100644 --- a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalTabDelimiterSpringTest.java +++ b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalTabDelimiterSpringTest.java @@ -20,10 +20,12 @@ import java.util.List; import org.apache.camel.EndpointInject; import org.apache.camel.component.mock.MockEndpoint; -import org.apache.camel.test.spring.CamelSpringTestSupport; -import org.junit.Test; +import org.apache.camel.test.junit5.spring.CamelSpringTestSupport; +import org.junit.jupiter.api.Test; import org.springframework.context.support.ClassPathXmlApplicationContext; +import static org.junit.jupiter.api.Assertions.assertEquals; + public class CsvUnmarshalTabDelimiterSpringTest extends CamelSpringTestSupport { @EndpointInject("mock:result") private MockEndpoint result; diff --git a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalTabDelimiterTest.java b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalTabDelimiterTest.java index 3f848f6..4ff804f 100644 --- a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalTabDelimiterTest.java +++ b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalTabDelimiterTest.java @@ -21,8 +21,10 @@ import java.util.List; import org.apache.camel.EndpointInject; 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.assertEquals; public class CsvUnmarshalTabDelimiterTest extends CamelTestSupport { diff --git a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalTest.java b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalTest.java index 63616cb..d099c64 100644 --- a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalTest.java +++ b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalTest.java @@ -26,10 +26,11 @@ import java.util.Map; import org.apache.camel.EndpointInject; 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.apache.camel.dataformat.csv.TestUtils.asMap; +import static org.junit.jupiter.api.Assertions.assertEquals; /** * This class tests standard unmarshalling diff --git a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalTwoCsvDataFormatConcurrentTest.java b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalTwoCsvDataFormatConcurrentTest.java index 044cd41..6f45b74 100644 --- a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalTwoCsvDataFormatConcurrentTest.java +++ b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalTwoCsvDataFormatConcurrentTest.java @@ -21,8 +21,10 @@ import java.util.List; import org.apache.camel.EndpointInject; 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.assertEquals; public class CsvUnmarshalTwoCsvDataFormatConcurrentTest extends CamelTestSupport { diff --git a/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelSpringBootJUnit4ClassRunner.java b/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelSpringBootJUnit4ClassRunner.java deleted file mode 100644 index d96c903..0000000 --- a/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelSpringBootJUnit4ClassRunner.java +++ /dev/null @@ -1,33 +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 org.apache.camel.test.junit5.spring; - -import org.junit.runners.model.InitializationError; - -/** - * The class {@link CamelSpringBootJUnit4ClassRunner} has been renamed to {@link CamelSpringBootRunner} - * which is a shorter and easier to remember name. - * - * @deprecated use {@link CamelSpringBootRunner} - */ -@Deprecated -public class CamelSpringBootJUnit4ClassRunner extends CamelSpringBootRunner { - - public CamelSpringBootJUnit4ClassRunner(Class<?> clazz) throws InitializationError { - super(clazz); - } -} diff --git a/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelSpringDelegatingTestContextLoader.java b/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelSpringDelegatingTestContextLoader.java deleted file mode 100644 index ce486e5..0000000 --- a/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelSpringDelegatingTestContextLoader.java +++ /dev/null @@ -1,138 +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 org.apache.camel.test.junit5.spring; - -import java.lang.reflect.Method; - -import org.apache.camel.api.management.JmxSystemPropertyKeys; -import org.apache.camel.spring.SpringCamelContext; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.support.BeanDefinitionRegistry; -import org.springframework.context.ApplicationContext; -import org.springframework.context.ConfigurableApplicationContext; -import org.springframework.context.annotation.AnnotationConfigUtils; -import org.springframework.test.context.MergedContextConfiguration; -import org.springframework.test.context.support.DelegatingSmartContextLoader; - -/** - * CamelSpringDelegatingTestContextLoader which fixes issues in Camel's JavaConfigContextLoader. (adds support for Camel's test annotations) - * <br> - * <em>This loader can handle either classes or locations for configuring the context.</em> - * <br> - * NOTE: This TestContextLoader doesn't support the annotation of ExcludeRoutes now. - * - * @deprecated use {@link CamelSpringRunner} or {@link CamelSpringBootRunner} instead. - */ -@Deprecated -public class CamelSpringDelegatingTestContextLoader extends DelegatingSmartContextLoader { - - protected final Logger logger = LoggerFactory.getLogger(getClass()); - - @Override - public ApplicationContext loadContext(MergedContextConfiguration mergedConfig) throws Exception { - - Class<?> testClass = getTestClass(); - - if (logger.isDebugEnabled()) { - logger.debug("Loading ApplicationContext for merged context configuration [{}].", mergedConfig); - } - - // Pre CamelContext(s) instantiation setup - CamelAnnotationsHandler.handleDisableJmx(null, testClass); - - try { - SpringCamelContext.setNoStart(true); - System.setProperty("skipStartingCamelContext", "true"); - ConfigurableApplicationContext context = (ConfigurableApplicationContext) super.loadContext(mergedConfig); - SpringCamelContext.setNoStart(false); - System.clearProperty("skipStartingCamelContext"); - return loadContext(context, testClass); - } finally { - cleanup(testClass); - } - } - - /** - * Performs the bulk of the Spring application context loading/customization. - * - * @param context the partially configured context. The context should have the bean definitions loaded, but nothing else. - * @param testClass the test class being executed - * @return the initialized (refreshed) Spring application context - * - * @throws Exception if there is an error during initialization/customization - */ - public ApplicationContext loadContext(ConfigurableApplicationContext context, Class<?> testClass) - throws Exception { - - AnnotationConfigUtils.registerAnnotationConfigProcessors((BeanDefinitionRegistry) context); - - // Post CamelContext(s) instantiation but pre CamelContext(s) start setup - CamelAnnotationsHandler.handleRouteCoverage(context, testClass, s -> getTestMethod().getName()); - CamelAnnotationsHandler.handleProvidesBreakpoint(context, testClass); - CamelAnnotationsHandler.handleShutdownTimeout(context, testClass); - CamelAnnotationsHandler.handleMockEndpoints(context, testClass); - CamelAnnotationsHandler.handleMockEndpointsAndSkip(context, testClass); - CamelAnnotationsHandler.handleUseOverridePropertiesWithPropertiesComponent(context, testClass); - - // CamelContext(s) startup - CamelAnnotationsHandler.handleCamelContextStartup(context, testClass); - - return context; - } - - /** - * Cleanup/restore global state to defaults / pre-test values after the test setup - * is complete. - * - * @param testClass the test class being executed - */ - protected void cleanup(Class<?> testClass) { - SpringCamelContext.setNoStart(false); - - if (testClass.isAnnotationPresent(DisableJmx.class)) { - if (CamelSpringTestHelper.getOriginalJmxDisabled() == null) { - System.clearProperty(JmxSystemPropertyKeys.DISABLED); - } else { - System.setProperty(JmxSystemPropertyKeys.DISABLED, - CamelSpringTestHelper.getOriginalJmxDisabled()); - } - } - } - - /** - * Returns the class under test in order to enable inspection of annotations while the - * Spring context is being created. - * - * @return the test class that is being executed - * @see CamelSpringTestHelper - */ - protected Class<?> getTestClass() { - return CamelSpringTestHelper.getTestClass(); - } - - /** - * Returns the test method under test. - * - * @return the method that is being executed - * @see CamelSpringTestHelper - */ - protected Method getTestMethod() { - return CamelSpringTestHelper.getTestMethod(); - } - -} diff --git a/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelSpringTestContextLoader.java b/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelSpringTestContextLoader.java index 99e52e0..43829e1 100644 --- a/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelSpringTestContextLoader.java +++ b/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelSpringTestContextLoader.java @@ -25,7 +25,6 @@ import java.util.LinkedList; import java.util.List; import java.util.Properties; import java.util.concurrent.TimeUnit; - import org.apache.camel.CamelContext; import org.apache.camel.ExtendedCamelContext; import org.apache.camel.api.management.JmxSystemPropertyKeys; diff --git a/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelSpringTestSupport.java b/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelSpringTestSupport.java index 839f675..0f89812 100644 --- a/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelSpringTestSupport.java +++ b/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelSpringTestSupport.java @@ -21,7 +21,6 @@ import java.util.HashSet; import java.util.List; import org.apache.camel.CamelContext; -import org.apache.camel.ExtendedCamelContext; import org.apache.camel.spring.SpringCamelContext; import org.apache.camel.test.ExcludingPackageScanClassResolver; import org.apache.camel.test.junit5.CamelTestSupport; diff --git a/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/RouteCoverageEventNotifier.java b/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/RouteCoverageEventNotifier.java index 7d7df3d..47c137c 100644 --- a/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/RouteCoverageEventNotifier.java +++ b/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/RouteCoverageEventNotifier.java @@ -20,7 +20,6 @@ import java.util.function.Function; import org.apache.camel.CamelContext; import org.apache.camel.spi.CamelEvent; -import org.apache.camel.spi.CamelEvent.CamelContextEvent; import org.apache.camel.spi.CamelEvent.CamelContextStoppingEvent; import org.apache.camel.support.EventNotifierSupport; diff --git a/components/camel-test-spring/src/test/java/org/apache/camel/test/issues/AdviceWithInterceptSendToEndpointWithLoadbalancerTest.java b/components/camel-test-spring/src/test/java/org/apache/camel/test/issues/AdviceWithInterceptSendToEndpointWithLoadbalancerTest.java index 1456d1d..928849f 100644 --- a/components/camel-test-spring/src/test/java/org/apache/camel/test/issues/AdviceWithInterceptSendToEndpointWithLoadbalancerTest.java +++ b/components/camel-test-spring/src/test/java/org/apache/camel/test/issues/AdviceWithInterceptSendToEndpointWithLoadbalancerTest.java @@ -19,8 +19,8 @@ package org.apache.camel.test.issues; import org.apache.camel.builder.RouteBuilder; import org.apache.camel.model.RouteDefinition; import org.apache.camel.reifier.RouteReifier; -import org.apache.camel.test.spring.CamelSpringTestSupport; -import org.junit.Test; +import org.apache.camel.test.junit5.spring.CamelSpringTestSupport; +import org.junit.jupiter.api.Test; import org.springframework.context.support.AbstractApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; diff --git a/components/camel-test-spring/src/test/java/org/apache/camel/test/issues/AdviceWithOnCompletionTest.java b/components/camel-test-spring/src/test/java/org/apache/camel/test/issues/AdviceWithOnCompletionTest.java index eeae215..3d9e94b 100644 --- a/components/camel-test-spring/src/test/java/org/apache/camel/test/issues/AdviceWithOnCompletionTest.java +++ b/components/camel-test-spring/src/test/java/org/apache/camel/test/issues/AdviceWithOnCompletionTest.java @@ -19,8 +19,8 @@ package org.apache.camel.test.issues; import org.apache.camel.builder.AdviceWithRouteBuilder; import org.apache.camel.model.RouteDefinition; import org.apache.camel.reifier.RouteReifier; -import org.apache.camel.test.spring.CamelSpringTestSupport; -import org.junit.Test; +import org.apache.camel.test.junit5.spring.CamelSpringTestSupport; +import org.junit.jupiter.api.Test; import org.springframework.context.support.AbstractApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; diff --git a/components/camel-test-spring/src/test/java/org/apache/camel/test/issues/AdviceWithOnExceptionMultipleIssueTest.java b/components/camel-test-spring/src/test/java/org/apache/camel/test/issues/AdviceWithOnExceptionMultipleIssueTest.java index a9c7007..9c56e77 100644 --- a/components/camel-test-spring/src/test/java/org/apache/camel/test/issues/AdviceWithOnExceptionMultipleIssueTest.java +++ b/components/camel-test-spring/src/test/java/org/apache/camel/test/issues/AdviceWithOnExceptionMultipleIssueTest.java @@ -20,8 +20,8 @@ import org.apache.camel.Exchange; import org.apache.camel.Processor; import org.apache.camel.builder.AdviceWithRouteBuilder; import org.apache.camel.reifier.RouteReifier; -import org.apache.camel.test.spring.CamelSpringTestSupport; -import org.junit.Test; +import org.apache.camel.test.junit5.spring.CamelSpringTestSupport; +import org.junit.jupiter.api.Test; import org.springframework.context.support.AbstractApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; diff --git a/components/camel-test-spring/src/test/java/org/apache/camel/test/issues/MockEndpointsAndSkipTest.java b/components/camel-test-spring/src/test/java/org/apache/camel/test/issues/MockEndpointsAndSkipTest.java index b2dcbff..132b100 100644 --- a/components/camel-test-spring/src/test/java/org/apache/camel/test/issues/MockEndpointsAndSkipTest.java +++ b/components/camel-test-spring/src/test/java/org/apache/camel/test/issues/MockEndpointsAndSkipTest.java @@ -16,8 +16,8 @@ */ package org.apache.camel.test.issues; -import org.apache.camel.test.spring.CamelSpringTestSupport; -import org.junit.Test; +import org.apache.camel.test.junit5.spring.CamelSpringTestSupport; +import org.junit.jupiter.api.Test; import org.springframework.context.support.AbstractApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext;