diff --git a/teku/src/test/java/tech/pegasys/teku/cli/options/P2POptionsTest.java b/teku/src/test/java/tech/pegasys/teku/cli/options/P2POptionsTest.java index 9f7c3aca6c4..3f1e71b2ea3 100644 --- a/teku/src/test/java/tech/pegasys/teku/cli/options/P2POptionsTest.java +++ b/teku/src/test/java/tech/pegasys/teku/cli/options/P2POptionsTest.java @@ -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(); @@ -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");