use of com.palantir.timelock.config.DefaultClusterConfiguration in project atlasdb by palantir.
the class TimeLockAgentTest method throwsIfStartedWithLessThanThreeServers_dangerousTopologyNotEnabled.
@Test
public void throwsIfStartedWithLessThanThreeServers_dangerousTopologyNotEnabled() {
DefaultClusterConfiguration dangerousTopologyConfig = ImmutableDefaultClusterConfiguration.builder().localServer(SERVER_A).cluster(PartialServiceConfiguration.of(ImmutableList.of(SERVER_A, SERVER_B), Optional.empty())).build();
assertThatThrownBy(() -> TimeLockAgent.verifyTopologyOffersHighAvailability(TimeLockInstallConfiguration.builder().paxos(createPaxosInstall(false, true, false)).build(), dangerousTopologyConfig)).isInstanceOf(SafeIllegalArgumentException.class);
}
use of com.palantir.timelock.config.DefaultClusterConfiguration in project atlasdb by palantir.
the class TimeLockAgentTest method doesNotThrowIfStartedWithLessThanThreeServers_dangerousTopologyEnabledInInstallConfig.
@Test
public void doesNotThrowIfStartedWithLessThanThreeServers_dangerousTopologyEnabledInInstallConfig() {
DefaultClusterConfiguration dangerousTopologyConfig = ImmutableDefaultClusterConfiguration.builder().localServer(SERVER_A).cluster(PartialServiceConfiguration.of(ImmutableList.of(SERVER_A, SERVER_B), Optional.empty())).build();
assertThatCode(() -> TimeLockAgent.verifyTopologyOffersHighAvailability(TimeLockInstallConfiguration.builder().paxos(createPaxosInstall(false, true, false)).cluster(ImmutableClusterInstallConfiguration.builder().enableNonstandardAndPossiblyDangerousTopology(true).build()).build(), dangerousTopologyConfig)).doesNotThrowAnyException();
}
use of com.palantir.timelock.config.DefaultClusterConfiguration in project atlasdb by palantir.
the class TimeLockAgentTest method doesNotThrowIfStartedWithLessThanThreeServers_dangerousTopologyEnabledInRuntimeConfig.
@Test
public void doesNotThrowIfStartedWithLessThanThreeServers_dangerousTopologyEnabledInRuntimeConfig() {
DefaultClusterConfiguration dangerousTopologyConfig = ImmutableDefaultClusterConfiguration.builder().localServer(SERVER_A).cluster(PartialServiceConfiguration.of(ImmutableList.of(SERVER_A, SERVER_B), Optional.empty())).enableNonstandardAndPossiblyDangerousTopology(true).build();
assertThatCode(() -> TimeLockAgent.verifyTopologyOffersHighAvailability(TimeLockInstallConfiguration.builder().paxos(createPaxosInstall(false, true, false)).build(), dangerousTopologyConfig)).doesNotThrowAnyException();
}
Aggregations