You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by or...@apache.org on 2022/05/31 15:23:17 UTC

[camel] 02/10: (chores) camel-jms: ensure tests have at least 1 assertion

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

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

commit fdcf4e9233104a221cec050cbb0d650261dc49da
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Tue May 31 14:54:55 2022 +0200

    (chores) camel-jms: ensure tests have at least 1 assertion
---
 .../JmsSendToAlotOfDestinationWithSameEndpointTest.java  | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/components/camel-jms/src/test/java/org/apache/camel/component/jms/issues/JmsSendToAlotOfDestinationWithSameEndpointTest.java b/components/camel-jms/src/test/java/org/apache/camel/component/jms/issues/JmsSendToAlotOfDestinationWithSameEndpointTest.java
index 99b760ee863..1a72136cca2 100644
--- a/components/camel-jms/src/test/java/org/apache/camel/component/jms/issues/JmsSendToAlotOfDestinationWithSameEndpointTest.java
+++ b/components/camel-jms/src/test/java/org/apache/camel/component/jms/issues/JmsSendToAlotOfDestinationWithSameEndpointTest.java
@@ -25,6 +25,8 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.context.support.AbstractXmlApplicationContext;
 
+import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
+
 public class JmsSendToAlotOfDestinationWithSameEndpointTest extends CamelSpringTestSupport {
 
     private static final Logger LOG = LoggerFactory.getLogger(JmsSendToAlotOfDestinationWithSameEndpointTest.class);
@@ -32,24 +34,28 @@ public class JmsSendToAlotOfDestinationWithSameEndpointTest extends CamelSpringT
 
     @Test
     public void testSendToAlotOfMessageToQueues() {
+        assertDoesNotThrow(() -> sendToAlotOfMessagesToQueue());
+
+        // now we should be able to poll a message from each queue
+        // Thread.sleep(99999999);
+    }
+
+    private void sendToAlotOfMessagesToQueue() {
         int size = 100;
 
-        LOG.info("About to send " + size + " messages");
+        LOG.info("About to send {} messages", size);
 
         for (int i = 0; i < size; i++) {
             // use the same endpoint but provide a header with the dynamic queue we send to
             // this allows us to reuse endpoints and not create a new endpoint for each and every jms queue
             // we send to
             if (i > 0 && i % 50 == 0) {
-                LOG.info("Send " + i + " messages so far");
+                LOG.info("Sent {} messages so far", i);
             }
             template.sendBodyAndHeader(URI, ExchangePattern.InOnly, "Hello " + i, JmsConstants.JMS_DESTINATION_NAME, "foo" + i);
         }
 
         LOG.info("Send complete use jconsole to view");
-
-        // now we should be able to poll a message from each queue
-        // Thread.sleep(99999999);
     }
 
     @Override