Skip to content

Commit

Permalink
Test new P2P Option
Browse files Browse the repository at this point in the history
  • Loading branch information
courtneyeh committed Apr 11, 2024
1 parent d920c82 commit 239ee7e
Showing 1 changed file with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public void shouldReadFromConfigurationFile() {
assertThat(p2pConfig.getTargetSubnetSubscriberCount()).isEqualTo(5);
assertThat(p2pConfig.getPeerRateLimit()).isEqualTo(100);
assertThat(p2pConfig.getPeerRequestLimit()).isEqualTo(101);
assertThat(p2pConfig.isP2pDumpsToFileEnabled()).isFalse();

final DiscoveryConfig discoConfig = tekuConfig.discovery();
assertThat(discoConfig.isDiscoveryEnabled()).isTrue();
Expand Down Expand Up @@ -139,6 +140,26 @@ void advertisedUdpPort_shouldDefaultToTcpListenPortWhenNeitherSet() {
.isEqualTo(tekuConfig.network().getAdvertisedPort());
}

@Test
void p2pDumpsToFileEnabled_shouldDefaultFalse() {
final TekuConfiguration tekuConfig = getTekuConfigurationFromArguments();
assertThat(tekuConfig.p2p().isP2pDumpsToFileEnabled()).isEqualTo(false);
}

@Test
void p2pDumpsToFileEnabled_shouldTrue() {
final TekuConfiguration tekuConfig =
getTekuConfigurationFromArguments("--Xp2p-dumps-to-file-enabled=true");
assertThat(tekuConfig.p2p().isP2pDumpsToFileEnabled()).isEqualTo(true);
}

@Test
void p2pDumpsToFileEnabled_shouldNotRequireAValue() {
final TekuConfiguration tekuConfig =
getTekuConfigurationFromArguments("--Xp2p-dumps-to-file-enabled");
assertThat(tekuConfig.p2p().isP2pDumpsToFileEnabled()).isEqualTo(true);
}

@Test
void advertisedUdpPort_shouldDefaultToTcpListenPortWhenListenPortSet() {
TekuConfiguration tekuConfiguration = getTekuConfigurationFromArguments("--p2p-port=8000");
Expand Down

0 comments on commit 239ee7e

Please sign in to comment.