[camel] branch master updated (bbc0b86 -> 92e3c4f)

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[camel] branch master updated (bbc0b86 -> 92e3c4f)

davsclaus-2
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git.


    from bbc0b86  CAMEL-14163: multiple request query parameters ...
     new 5528d3c  [CAMEL-14156] Avoid NPE with endpoint is null in JmsBinding (#3328)
     new 92e3c4f  [CAMEL-14156] Avoid NPE with endpoint is null in JmsBinding (#3328)

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../org/apache/camel/component/jms/JmsBindingTest.java   | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

Reply | Threaded
Open this post in threaded view
|

[camel] 01/02: [CAMEL-14156] Avoid NPE with endpoint is null in JmsBinding (#3328)

davsclaus-2
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 5528d3c1568a7d3da30866c4d0f23b0c72c22303
Author: Jean-Baptiste Onofré <[hidden email]>
AuthorDate: Fri Nov 8 22:14:12 2019 +0100

    [CAMEL-14156] Avoid NPE with endpoint is null in JmsBinding (#3328)
---
 .../org/apache/camel/component/jms/JmsBindingTest.java    | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsBindingTest.java b/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsBindingTest.java
index 00f70d7..1c29e26 100644
--- a/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsBindingTest.java
+++ b/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsBindingTest.java
@@ -22,6 +22,9 @@ import java.time.Instant;
 import java.util.Date;
 
 import org.apache.activemq.command.ActiveMQBlobMessage;
+import org.apache.activemq.command.ActiveMQTextMessage;
+import org.apache.camel.impl.DefaultCamelContext;
+import org.apache.camel.impl.DefaultExchange;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -54,6 +57,18 @@ public class JmsBindingTest {
     }
 
     @Test
+    public void noEndpointTest() throws Exception {
+        JmsBinding testBindingWithoutEndpoint = new JmsBinding();
+        ActiveMQTextMessage message = new ActiveMQTextMessage();
+        message.setText("test");
+        DefaultCamelContext camelContext = new DefaultCamelContext();
+        DefaultExchange exchange = new DefaultExchange(camelContext);
+        exchange.getIn().setBody("test");
+        exchange.getIn().setHeader("JMSCorrelationID", null);
+        testBindingWithoutEndpoint.appendJmsProperties(message, exchange);
+    }
+
+    @Test
     public void testExtractNullBodyFromJmsShouldReturnNull() throws Exception {
         assertNull(jmsBindingUnderTest.extractBodyFromJms(null, new ActiveMQBlobMessage()));
     }

Reply | Threaded
Open this post in threaded view
|

[camel] 02/02: [CAMEL-14156] Avoid NPE with endpoint is null in JmsBinding (#3328)

davsclaus-2
In reply to this post by davsclaus-2
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 92e3c4f43ec4dc95b41698166d5c1c1c0ff358bb
Author: Claus Ibsen <[hidden email]>
AuthorDate: Fri Nov 8 22:18:52 2019 +0100

    [CAMEL-14156] Avoid NPE with endpoint is null in JmsBinding (#3328)
---
 .../src/test/java/org/apache/camel/component/jms/JmsBindingTest.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsBindingTest.java b/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsBindingTest.java
index 1c29e26..9562b8b 100644
--- a/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsBindingTest.java
+++ b/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsBindingTest.java
@@ -23,8 +23,9 @@ import java.util.Date;
 
 import org.apache.activemq.command.ActiveMQBlobMessage;
 import org.apache.activemq.command.ActiveMQTextMessage;
+import org.apache.camel.Exchange;
 import org.apache.camel.impl.DefaultCamelContext;
-import org.apache.camel.impl.DefaultExchange;
+
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -62,7 +63,7 @@ public class JmsBindingTest {
         ActiveMQTextMessage message = new ActiveMQTextMessage();
         message.setText("test");
         DefaultCamelContext camelContext = new DefaultCamelContext();
-        DefaultExchange exchange = new DefaultExchange(camelContext);
+        Exchange exchange = camelContext.getEndpoint("jms:queue:foo").createExchange();
         exchange.getIn().setBody("test");
         exchange.getIn().setHeader("JMSCorrelationID", null);
         testBindingWithoutEndpoint.appendJmsProperties(message, exchange);