Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
acogoluegnes committed Oct 31, 2024
1 parent d9fca36 commit 5954cdd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/test/java/com/rabbitmq/perf/MulticastSetTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ public void waitUntilBrokerAvailableIfNecessaryShouldReturnTrueOnceEnoughBrokers

@Test
public void createConnectionAddressesNotUsedWhenNoUriList() throws Exception {
when(factory.newConnection(anyString())).thenReturn(connection);
MulticastSet multicastSet = getMulticastSet(new ArrayList<>());
multicastSet.createConnection("connection-1");
assertThat(multicastSet.createConfigurationConnections()).hasSize(1);
Expand All @@ -271,6 +272,7 @@ public void createConnectionAddressesNotUsedWhenNoUriList() throws Exception {

@Test
public void createConnectionFromOneUri() throws Exception {
when(factory.newConnection(anyList(), anyString())).thenReturn(connection);
MulticastSet multicastSet = getMulticastSet(Arrays.asList("amqp://host1:5673"));
multicastSet.createConnection("connection-1");
ArgumentCaptor<List<Address>> addresses = addressesArgumentCaptor();
Expand All @@ -285,6 +287,7 @@ public void createConnectionFromOneUri() throws Exception {

@Test
public void createConfigurationConnectionFromOneUri() throws Exception {
when(factory.newConnection(anyList(), anyString())).thenReturn(connection);
MulticastSet multicastSet = getMulticastSet(Arrays.asList("amqp://host1:5673"));
assertThat(multicastSet.createConfigurationConnections()).hasSize(1);
ArgumentCaptor<List<Address>> addresses = addressesArgumentCaptor();
Expand All @@ -300,6 +303,7 @@ public void createConfigurationConnectionFromOneUri() throws Exception {

@Test
public void createConnectionFromSeveralUrisShufflingShouldHappen() throws Exception {
when(factory.newConnection(anyList(), anyString())).thenReturn(connection);
List<String> uris =
IntStream.range(0, 100).mapToObj(i -> "amqp://host" + i).collect(Collectors.toList());
MulticastSet multicastSet = getMulticastSet(uris);
Expand All @@ -323,6 +327,7 @@ public void createConnectionFromSeveralUrisShufflingShouldHappen() throws Except
@Test
public void createConfigurationConnectionFromSeveralUrisConnectionShouldBeSpread()
throws Exception {
when(factory.newConnection(anyList(), anyString())).thenReturn(connection);
int hostCount = 5;
List<String> uris =
IntStream.range(0, hostCount)
Expand Down

0 comments on commit 5954cdd

Please sign in to comment.