Skip to content

Commit

Permalink
Merge pull request #7308 from alvasw/Add_FederatedBtcNodeProviderTest…
Browse files Browse the repository at this point in the history
….onlyHardcodedNodes_test

Add FederatedBtcNodeProviderTest.onlyHardcodedNodes test
  • Loading branch information
alejandrogarcia83 authored Nov 20, 2024
2 parents 624467a + f7d80ee commit 633c9c1
Showing 1 changed file with 32 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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);
}
}

0 comments on commit 633c9c1

Please sign in to comment.