Skip to content

Commit

Permalink
Merge c231576 into 79f5eee
Browse files Browse the repository at this point in the history
  • Loading branch information
mapingo committed Aug 16, 2018
2 parents 79f5eee + c231576 commit b2cdcf7
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
package uk.gov.justice.artemis.manager.connector;

import static java.util.Arrays.asList;
import static org.hamcrest.Matchers.arrayContainingInAnyOrder;
import static org.hamcrest.Matchers.empty;
import static org.hamcrest.Matchers.hasSize;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.not;
import static org.hamcrest.Matchers.nullValue;
import static org.junit.Assert.assertThat;
import static uk.gov.justice.artemis.manager.util.JmsTestUtil.cleanQueue;
import static uk.gov.justice.artemis.manager.util.JmsTestUtil.cleanTopic;
import static uk.gov.justice.artemis.manager.util.JmsTestUtil.closeJmsConnection;
import static uk.gov.justice.artemis.manager.util.JmsTestUtil.openJmsConnection;
import static uk.gov.justice.artemis.manager.util.JmsTestUtil.putInQueue;
Expand Down Expand Up @@ -148,4 +150,21 @@ public void shouldReprocessMessageOntoOriginalQueue() throws Exception {
assertThat(reprocessedMessages, is(2L));
assertThat(messageDataAfter, is(empty()));
}

@Test
public void shouldReturnListOfQueues() throws Exception {
final String[] queueNames = combinedArtemisConnector.queueNames("localhost", "3000", "0.0.0.0");
assertThat(queueNames, arrayContainingInAnyOrder("DLQ", "ExpiryQueue"));
}

@Test
public void shouldReturnListOfTopics() throws Exception {
final String topic = "testTopic";

cleanTopic(topic, "testSubscription");

final String[] topicNames = combinedArtemisConnector.topicNames("localhost", "3000", "0.0.0.0");

assertThat(topicNames, arrayContainingInAnyOrder("testTopic"));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public void shouldReturnNumberOfDeletedMessages() throws Exception {
@Test
public void shouldReturnListOfQueues() throws Exception {
final String[] queueNames = jmxArtemisConnector.queueNames("localhost", "3000", "0.0.0.0");
assertThat(queueNames, arrayContainingInAnyOrder(new String[] {"DLQ", "ExpiryQueue"}));
assertThat(queueNames, arrayContainingInAnyOrder("DLQ", "ExpiryQueue"));
}

@Test
Expand All @@ -128,6 +128,6 @@ public void shouldReturnListOfTopics() throws Exception {

final String[] topicNames = jmxArtemisConnector.topicNames("localhost", "3000", "0.0.0.0");

assertThat(topicNames, arrayContainingInAnyOrder(new String[] {"testTopic"}));
assertThat(topicNames, arrayContainingInAnyOrder("testTopic"));
}
}

0 comments on commit b2cdcf7

Please sign in to comment.