Source:
private void createPublishAndSubscribeFromUser(String userKey, String destinationName) throws XPathExpressionException, AndesClientConfigurationException, IOException, JMSException, AndesClientException, NamingException { long sendCount = 10L; long expectedCount = 10L; AutomationContext userAutomationContext = new AutomationContext("MB", "mb001", FrameworkConstants.SUPER_TENANT_KEY, userKey); User contextUser = userAutomationContext.getContextTenant().getContextUser(); AndesJMSConsumerClientConfiguration consumerConfig = new AndesJMSConsumerClientConfiguration(contextUser .getUserNameWithoutDomain(), contextUser .getPassword(), "127.0.0.1", 5672, ExchangeType.TOPIC, destinationName); consumerConfig.setMaximumMessagesToReceived(expectedCount); AndesJMSPublisherClientConfiguration publisherConfig = new AndesJMSPublisherClientConfiguration(contextUser .getUserNameWithoutDomain(), contextUser .getPassword(), "127.0.0.1", 5672, ExchangeType.TOPIC, destinationName); publisherConfig.setNumberOfMessagesToSend(sendCount); AndesClient consumerClient = new AndesClient(consumerConfig, true); consumerClient.startClient(); AndesClient publisherClient = new AndesClient(publisherConfig, true); publisherClient.startClient(); AndesClientUtils .waitForMessagesAndShutdown(consumerClient, AndesClientConstants.DEFAULT_RUN_TIME); Assert.assertEquals(publisherClient .getSentMessageCount(), sendCount, "Message sending failed for user : " + contextUser .getUserNameWithoutDomain()); Assert.assertEquals(consumerClient .getReceivedMessageCount(), expectedCount, "Message receiving failed for user : " + contextUser .getUserNameWithoutDomain()); }

Target:
private void createPublishAndSubscribeFromUser(String userKey, String destinationName) throws XPathExpressionException, AndesClientConfigurationException, IOException, JMSException, AndesClientException, NamingException { long sendCount = 10L; long expectedCount = 10L; AutomationContext userAutomationContext = new AutomationContext("MB", "mb001", FrameworkConstants.SUPER_TENANT_KEY, userKey); User contextUser = userAutomationContext.getContextTenant().getContextUser(); AndesJMSConsumerClientConfiguration consumerConfig = new AndesJMSConsumerClientConfiguration( contextUser.getUserNameWithoutDomain(), contextUser.getPassword(), ExchangeType.TOPIC, destinationName); consumerConfig.setMaximumMessagesToReceived(expectedCount); AndesJMSPublisherClientConfiguration publisherConfig = new AndesJMSPublisherClientConfiguration( contextUser.getUserNameWithoutDomain(), contextUser.getPassword(), ExchangeType.TOPIC, destinationName); publisherConfig.setNumberOfMessagesToSend(sendCount); AndesClient consumerClient = new AndesClient(consumerConfig, true); consumerClient.startClient(); AndesClient publisherClient = new AndesClient(publisherConfig, true); publisherClient.startClient(); AndesClientUtils .waitForMessagesAndShutdown(consumerClient, AndesClientConstants.DEFAULT_RUN_TIME); Assert.assertEquals(publisherClient.getSentMessageCount(), sendCount, "Message sending " + "failed for user : " + contextUser.getUserNameWithoutDomain()); Assert.assertEquals(consumerClient.getReceivedMessageCount(), expectedCount, "Message " + "receiving failed for user : " + contextUser.getUserNameWithoutDomain()); }