From 3ca02955bf6f6f3d685553283d5d9ddc763e6ecc Mon Sep 17 00:00:00 2001 From: Justin Bertram Date: Thu, 27 May 2021 13:01:16 -0500 Subject: [PATCH] NO-JIRA make TransferTest more robust, readable --- .../org/apache/activemq/cli/test/TransferTest.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/artemis-cli/src/test/java/org/apache/activemq/cli/test/TransferTest.java b/artemis-cli/src/test/java/org/apache/activemq/cli/test/TransferTest.java index 70837ef9cb..7271c02010 100644 --- a/artemis-cli/src/test/java/org/apache/activemq/cli/test/TransferTest.java +++ b/artemis-cli/src/test/java/org/apache/activemq/cli/test/TransferTest.java @@ -18,6 +18,8 @@ package org.apache.activemq.cli.test; import org.apache.activemq.artemis.api.core.Pair; +import org.apache.activemq.artemis.api.core.QueueConfiguration; +import org.apache.activemq.artemis.api.core.RoutingType; import org.apache.activemq.artemis.cli.commands.messages.Transfer; import org.apache.activemq.artemis.core.server.ActiveMQServer; import org.apache.activemq.artemis.core.server.Queue; @@ -69,14 +71,15 @@ public class TransferTest extends CliTestBase { String sourceQueueName = "SOURCE_QUEUE"; String targetQueueName = "TARGET_QUEUE"; + server.createQueue(new QueueConfiguration(sourceQueueName).setRoutingType(RoutingType.ANYCAST)); + server.createQueue(new QueueConfiguration(targetQueueName).setRoutingType(RoutingType.ANYCAST)); + Session session = createSession(connection); produceMessages(session, sourceQueueName, messages, false); - Queue sourceQueue = server.locateQueue(sourceQueueName); Wait.assertEquals(messages, sourceQueue::getMessageCount); - Assert.assertEquals(messages, sourceQueue.getMessageCount()); Transfer transfer = new Transfer() .setSourceUser("admin") @@ -84,7 +87,8 @@ public class TransferTest extends CliTestBase { .setSourceQueue(sourceQueueName) .setTargetUser("admin") .setTargetPassword("admin") - .setTargetQueue(targetQueueName).setReceiveTimeout(100); + .setTargetQueue(targetQueueName) + .setReceiveTimeout(100); if (limit > 0) { transfer.setMessageCount(limit);