You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by nf...@apache.org on 2022/10/17 08:44:40 UTC

[camel] branch main updated: CAMEL-18608: Fix the test XmppMultiUserChatIT.testXmppChat

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

nfilotto 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 69c5ba70a20 CAMEL-18608: Fix the test XmppMultiUserChatIT.testXmppChat
69c5ba70a20 is described below

commit 69c5ba70a20e024696387d1bc693ab436577ed71
Author: Nicolas Filotto <nf...@talend.com>
AuthorDate: Mon Oct 17 10:44:19 2022 +0200

    CAMEL-18608: Fix the test XmppMultiUserChatIT.testXmppChat
---
 .../xmpp/integration/XmppMultiUserChatIT.java      | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/components/camel-xmpp/src/test/java/org/apache/camel/component/xmpp/integration/XmppMultiUserChatIT.java b/components/camel-xmpp/src/test/java/org/apache/camel/component/xmpp/integration/XmppMultiUserChatIT.java
index 4898a7f00bc..7b05d5c24da 100644
--- a/components/camel-xmpp/src/test/java/org/apache/camel/component/xmpp/integration/XmppMultiUserChatIT.java
+++ b/components/camel-xmpp/src/test/java/org/apache/camel/component/xmpp/integration/XmppMultiUserChatIT.java
@@ -16,26 +16,28 @@
  */
 package org.apache.camel.component.xmpp.integration;
 
+import java.util.concurrent.TimeUnit;
+
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
 import org.junit.jupiter.api.Test;
 
-public class XmppMultiUserChatIT extends XmppBaseIT {
+class XmppMultiUserChatIT extends XmppBaseIT {
 
-    protected MockEndpoint consumerEndpoint;
-    protected String body1 = "the first message";
-    protected String body2 = "the second message";
+    private static final String BODY_1 = "the first message";
+    private static final String BODY_2 = "the second message";
 
     @Test
-    public void testXmppChat() throws Exception {
-        consumerEndpoint = context.getEndpoint("mock:out", MockEndpoint.class);
-        consumerEndpoint.expectedBodiesReceived(body1, body2);
+    void testXmppChat() throws Exception {
+        MockEndpoint consumerEndpoint = context.getEndpoint("mock:out", MockEndpoint.class);
+        consumerEndpoint.expectedBodiesReceived(BODY_1, BODY_2);
 
         //will send chat messages to the room
-        template.sendBody("direct:toProducer", body1);
+        template.sendBody("direct:toProducer", BODY_1);
         Thread.sleep(50);
-        template.sendBody("direct:toProducer", body2);
+        template.sendBody("direct:toProducer", BODY_2);
 
+        consumerEndpoint.setResultWaitTime(TimeUnit.MINUTES.toMillis(1));
         consumerEndpoint.assertIsSatisfied();
     }
 
@@ -54,7 +56,7 @@ public class XmppMultiUserChatIT extends XmppBaseIT {
     }
 
     protected String getProducerUri() {
-        // the nickname parameter is necessary in these URLs because the '@' in the user name can not be parsed by
+        // the nickname parameter is necessary in these URLs because the '@' in the username can not be parsed by
         // vysper during chat room message routing.
 
         // here on purpose we provide the room query parameter without the domain name as 'camel-test', and Camel