@Value.Default public PaxosRuntimeConfiguration paxos() { return ImmutablePaxosRuntimeConfiguration.builder().build(); }
@Test public void throwOnNegativeMaximumWaitBeforeProposingLeadership() { assertThatThrownBy(ImmutablePaxosRuntimeConfiguration.builder() .maximumWaitBeforeProposalMs(NEGATIVE_LONG) ::build).isInstanceOf(IllegalArgumentException.class); }
@Test public void throwOnNegativePingRate() { assertThatThrownBy(ImmutablePaxosRuntimeConfiguration.builder() .pingRateMs(NEGATIVE_LONG) ::build).isInstanceOf(IllegalArgumentException.class); }
@Test public void throwOnNegativeLeaderPingResponseWait() { assertThatThrownBy(ImmutablePaxosRuntimeConfiguration.builder() .leaderPingResponseWaitMs(NEGATIVE_LONG) ::build).isInstanceOf(IllegalArgumentException.class); } }
@Test public void canSpecifyPositiveMaximumWaitBeforeProposingLeadership() { ImmutablePaxosRuntimeConfiguration.builder() .maximumWaitBeforeProposalMs(POSITIVE_LONG) .build(); }
@Test public void canSpecifyPositivePingRate() { ImmutablePaxosRuntimeConfiguration.builder() .pingRateMs(POSITIVE_LONG) .build(); }
@Test public void canSpecifyPositiveLeaderPingResponseWait() { ImmutablePaxosRuntimeConfiguration.builder() .leaderPingResponseWaitMs(POSITIVE_LONG) .build(); }
.paxos(ImmutablePaxosRuntimeConfiguration.builder() .leaderPingResponseWaitMs(paxos.leaderPingResponseWaitMs()) .maximumWaitBeforeProposalMs(paxos.maximumWaitBeforeProposalMs())