You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2021/08/26 12:43:01 UTC
[camel] branch main updated: CAMEL-16184: Use junit 5 for testing
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new a5e20fb CAMEL-16184: Use junit 5 for testing
a5e20fb is described below
commit a5e20fb79104c3aea9af99a19cd1a588002c150a
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Thu Aug 26 14:42:31 2021 +0200
CAMEL-16184: Use junit 5 for testing
---
components/camel-json-patch/pom.xml | 14 +++++++++++++-
.../src/main/docs/json-patch-component.adoc | 2 +-
.../camel/component/jsonpatch/JsonPatchProducer.java | 1 -
.../camel/component/jsonpatch/JsonPatchComponentTest.java | 6 ++++--
.../camel-json-patch/src/test/resources/log4j2.properties | 10 ++++++++--
.../modules/ROOT/pages/json-patch-component.adoc | 2 +-
6 files changed, 27 insertions(+), 8 deletions(-)
diff --git a/components/camel-json-patch/pom.xml b/components/camel-json-patch/pom.xml
index ec60652..b3d57c6 100644
--- a/components/camel-json-patch/pom.xml
+++ b/components/camel-json-patch/pom.xml
@@ -32,6 +32,7 @@
<description>Camel JsonPatch Component</description>
<dependencies>
+
<dependency>
<groupId>com.github.java-json-tools</groupId>
<artifactId>json-patch</artifactId>
@@ -45,9 +46,20 @@
<dependency>
<groupId>org.apache.camel</groupId>
- <artifactId>camel-test</artifactId>
+ <artifactId>camel-test-junit5</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-slf4j-impl</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.junit.jupiter</groupId>
+ <artifactId>junit-jupiter</artifactId>
+ <scope>test</scope>
+ </dependency>
+
</dependencies>
</project>
diff --git a/components/camel-json-patch/src/main/docs/json-patch-component.adoc b/components/camel-json-patch/src/main/docs/json-patch-component.adoc
index f466f3f..5145e8b 100644
--- a/components/camel-json-patch/src/main/docs/json-patch-component.adoc
+++ b/components/camel-json-patch/src/main/docs/json-patch-component.adoc
@@ -12,7 +12,7 @@ include::{cq-version}@camel-quarkus:ROOT:partial$reference/components/json-patch
*{component-header}*
-The Jslt component allows you to process a JSON messages using an
+The JsonPatch component allows you to process a JSON messages using an
https://github.com/schibsted/jslt[JSLT] expression. This can be
ideal when doing JSON to JSON transformation or querying data.
diff --git a/components/camel-json-patch/src/main/java/org/apache/camel/component/jsonpatch/JsonPatchProducer.java b/components/camel-json-patch/src/main/java/org/apache/camel/component/jsonpatch/JsonPatchProducer.java
index 1e8cb2a..15f591c 100644
--- a/components/camel-json-patch/src/main/java/org/apache/camel/component/jsonpatch/JsonPatchProducer.java
+++ b/components/camel-json-patch/src/main/java/org/apache/camel/component/jsonpatch/JsonPatchProducer.java
@@ -49,7 +49,6 @@ public class JsonPatchProducer extends DefaultProducer {
JsonNode input = objectMapper.readTree(exchange.getIn().getBody(String.class));
JsonNode result = patch.apply(input);
exchange.getMessage().setBody(result.toString());
-
}
}
diff --git a/components/camel-json-patch/src/test/java/org/apache/camel/component/jsonpatch/JsonPatchComponentTest.java b/components/camel-json-patch/src/test/java/org/apache/camel/component/jsonpatch/JsonPatchComponentTest.java
index 9ce3786..7999bc5 100644
--- a/components/camel-json-patch/src/test/java/org/apache/camel/component/jsonpatch/JsonPatchComponentTest.java
+++ b/components/camel-json-patch/src/test/java/org/apache/camel/component/jsonpatch/JsonPatchComponentTest.java
@@ -18,8 +18,10 @@ package org.apache.camel.component.jsonpatch;
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 JsonPatchComponentTest extends CamelTestSupport {
diff --git a/components/camel-json-patch/src/test/resources/log4j2.properties b/components/camel-json-patch/src/test/resources/log4j2.properties
index d9f0508..f051c57 100644
--- a/components/camel-json-patch/src/test/resources/log4j2.properties
+++ b/components/camel-json-patch/src/test/resources/log4j2.properties
@@ -15,9 +15,15 @@
## limitations under the License.
## ---------------------------------------------------------------------------
+appender.file.type = File
+appender.file.name = file
+appender.file.fileName = target/camel-json-path-test.log
+appender.file.layout.type = PatternLayout
+appender.file.layout.pattern = %d [%-15.15t] %-5p %-30.30c{1} - %m%n
appender.out.type = Console
appender.out.name = out
appender.out.layout.type = PatternLayout
-appender.out.layout.pattern = [%30.30t] %-30.30c{1} %-5p %m%n
+appender.out.layout.pattern = %d [%-15.15t] %-5p %-30.30c{1} - %m%n
rootLogger.level = INFO
-rootLogger.appenderRef.out.ref = out
+rootLogger.appenderRef.file.ref = file
+#rootLogger.appenderRef.out.ref = out
diff --git a/docs/components/modules/ROOT/pages/json-patch-component.adoc b/docs/components/modules/ROOT/pages/json-patch-component.adoc
index 32daf85..b340c35 100644
--- a/docs/components/modules/ROOT/pages/json-patch-component.adoc
+++ b/docs/components/modules/ROOT/pages/json-patch-component.adoc
@@ -14,7 +14,7 @@ include::{cq-version}@camel-quarkus:ROOT:partial$reference/components/json-patch
*{component-header}*
-The Jslt component allows you to process a JSON messages using an
+The JsonPatch component allows you to process a JSON messages using an
https://github.com/schibsted/jslt[JSLT] expression. This can be
ideal when doing JSON to JSON transformation or querying data.