|
1 | 1 | /* |
2 | | - * Copyright 2002-2021 the original author or authors. |
| 2 | + * Copyright 2002-2022 the original author or authors. |
3 | 3 | * |
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | 5 | * you may not use this file except in compliance with the License. |
|
24 | 24 | import static org.mockito.ArgumentMatchers.anyInt; |
25 | 25 | import static org.mockito.ArgumentMatchers.anyLong; |
26 | 26 | import static org.mockito.ArgumentMatchers.anyString; |
| 27 | +import static org.mockito.ArgumentMatchers.argThat; |
27 | 28 | import static org.mockito.ArgumentMatchers.eq; |
28 | 29 | import static org.mockito.ArgumentMatchers.isNull; |
29 | 30 | import static org.mockito.BDDMockito.given; |
|
65 | 66 | import org.junit.jupiter.api.Disabled; |
66 | 67 | import org.junit.jupiter.api.Test; |
67 | 68 | import org.mockito.ArgumentCaptor; |
| 69 | +import org.mockito.ArgumentMatcher; |
68 | 70 | import org.mockito.InOrder; |
69 | 71 |
|
70 | 72 | import org.springframework.amqp.AmqpConnectException; |
@@ -1657,8 +1659,10 @@ public void setAddressesTwoHosts() throws Exception { |
1657 | 1659 | ccf.createConnection(); |
1658 | 1660 | verify(mock).isAutomaticRecoveryEnabled(); |
1659 | 1661 | verify(mock).setAutomaticRecoveryEnabled(false); |
1660 | | - verify(mock).newConnection(isNull(), |
1661 | | - eq(Arrays.asList(new Address("mq1"), new Address("mq2"))), anyString()); |
| 1662 | + verify(mock).newConnection( |
| 1663 | + isNull(), |
| 1664 | + argThat((ArgumentMatcher<List<Address>>) a -> a.size() == 2 && a.contains(new Address("mq1")) && a.contains(new Address("mq2"))), |
| 1665 | + anyString()); |
1662 | 1666 | verifyNoMoreInteractions(mock); |
1663 | 1667 | } |
1664 | 1668 |
|
|
0 commit comments