-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7308 from alvasw/Add_FederatedBtcNodeProviderTest…
….onlyHardcodedNodes_test Add FederatedBtcNodeProviderTest.onlyHardcodedNodes test
- Loading branch information
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
core/src/test/java/bisq/core/btc/nodes/FederatedBtcNodeProviderTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |