mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-28 17:15:14 +01:00
Add FederatedBtcNodeProviderTest.onlyHardcodedNodes test
This commit is contained in:
parent
7a683ce52e
commit
a0ff6073ac
1 changed files with 32 additions and 0 deletions
|
@ -0,0 +1,32 @@
|
|||
package bisq.core.btc.nodes;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertIterableEquals;
|
||||
|
||||
public class FederatedBtcNodeProviderTest {
|
||||
@Test
|
||||
void onlyHardcodedNodes() {
|
||||
var hardcodedNodes = List.of(
|
||||
new BtcNodes.BtcNode(null, "alice.onion", null,
|
||||
BtcNodes.BtcNode.DEFAULT_PORT, "@alice"),
|
||||
new BtcNodes.BtcNode(null, "bob.onion", null,
|
||||
BtcNodes.BtcNode.DEFAULT_PORT, "@bob"),
|
||||
new BtcNodes.BtcNode(null, "charlie.onion", null,
|
||||
BtcNodes.BtcNode.DEFAULT_PORT, "@charlie")
|
||||
);
|
||||
|
||||
List<BtcNodes.BtcNode> mutableHardcodedList = new ArrayList<>(hardcodedNodes);
|
||||
List<String> filterProvidedBtcNodes = Collections.emptyList();
|
||||
List<String> bannedBtcNodes = Collections.emptyList();
|
||||
|
||||
List<BtcNodes.BtcNode> selectedNodes = FederatedBtcNodeProvider
|
||||
.getNodes(mutableHardcodedList, filterProvidedBtcNodes, bannedBtcNodes);
|
||||
|
||||
assertIterableEquals(hardcodedNodes, selectedNodes);
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue