ARTEMIS-4252 Refine waitForBridges

This commit is contained in:
Domenico Francesco Bruscino 2023-04-26 18:47:55 +02:00 committed by Justin Bertram
parent cc9db6b2f7
commit 126765decc
2 changed files with 3 additions and 4 deletions

View File

@ -632,8 +632,10 @@ public final class ClusterConnectionImpl implements ClusterConnection, AfterConn
@Override
public Bridge[] getBridges() {
synchronized (recordsGuard) {
return records.values().stream().map(MessageFlowRecord::getBridge).toArray(Bridge[]::new);
}
}
@Override
public Map<String, String> getNodes() {

View File

@ -121,7 +121,6 @@ import org.apache.activemq.artemis.core.server.JournalType;
import org.apache.activemq.artemis.core.server.MessageReference;
import org.apache.activemq.artemis.core.server.NodeManager;
import org.apache.activemq.artemis.core.server.Queue;
import org.apache.activemq.artemis.core.server.cluster.Bridge;
import org.apache.activemq.artemis.core.server.cluster.ClusterConnection;
import org.apache.activemq.artemis.core.server.cluster.ClusterManager;
import org.apache.activemq.artemis.core.server.cluster.RemoteQueueBinding;
@ -1335,8 +1334,6 @@ public abstract class ActiveMQTestBase extends Assert {
}
protected static final void waitForBridges(ClusterConnection clusterConnection, int connectedBridges) throws Exception {
Bridge[] bridges = clusterConnection.getBridges();
Wait.assertTrue(() -> Arrays.stream(clusterConnection.getBridges())
.filter(bridge -> bridge.isConnected()).count() >= connectedBridges);
}