Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase test coverage #13

Merged
merged 1 commit into from
Aug 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"));
}
}