public void Should_load_default_HealthCheck_Settings() { var settings = new HealthCheckSettings(HealthCheckSettings.DefaultConfig().GetConfig("akka.healthcheck")); settings.Misconfigured.Should().BeFalse(); settings.LivenessProbeProvider.Should().Be(typeof(DefaultLivenessProvider)); settings.ReadinessProbeProvider.Should().Be(typeof(DefaultReadinessProvider)); settings.LivenessTransport.Should().Be(ProbeTransport.Custom); settings.ReadinessTransport.Should().Be(ProbeTransport.Custom); settings.LivenessTransportSettings.Should().BeOfType <CustomTransportSettings>(); settings.ReadinessTransportSettings.Should().BeOfType <CustomTransportSettings>(); }
public void Should_signal_misconfiguration_when_Readiness_provider_is_invalid() { var hocon = ConfigurationFactory.ParseString(@" akka.healthcheck.readiness.provider = ""Akka.Fake.FakeProvider, Akka.Fake"" "); var settings = new HealthCheckSettings(hocon.WithFallback(HealthCheckSettings.DefaultConfig()) .GetConfig("akka.healthcheck")); settings.Misconfigured.Should().BeTrue(); settings.LivenessProbeProvider.Should().Be(typeof(DefaultLivenessProvider)); settings.ReadinessProbeProvider.Should().Be(typeof(DefaultReadinessProvider)); }
public void Should_load_non_default_Log_Settings() { var hocon = ConfigurationFactory.ParseString(@" akka.healthcheck{ log-config-on-start = off log-info = off }"); var settings = new HealthCheckSettings(hocon.WithFallback(HealthCheckSettings.DefaultConfig()) .GetConfig("akka.healthcheck")); settings.LogConfigOnStart.Should().BeFalse(); settings.LogInfoEvents.Should().BeFalse(); }
public void Should_load_non_default_Transport_values() { var hocon = ConfigurationFactory.ParseString(@" akka.healthcheck.readiness.transport = file akka.healthcheck.liveness.transport = tcp "); var settings = new HealthCheckSettings(hocon.WithFallback(HealthCheckSettings.DefaultConfig()) .GetConfig("akka.healthcheck")); settings.Misconfigured.Should().BeFalse(); settings.LivenessProbeProvider.Should().Be(typeof(DefaultLivenessProvider)); settings.ReadinessProbeProvider.Should().Be(typeof(DefaultReadinessProvider)); settings.LivenessTransport.Should().Be(ProbeTransport.TcpSocket); settings.ReadinessTransport.Should().Be(ProbeTransport.File); settings.LivenessTransportSettings.Should().BeOfType <SocketTransportSettings>(); settings.LivenessTransportSettings.As <SocketTransportSettings>().Port.Should().Be(11000); settings.ReadinessTransportSettings.Should().BeOfType <FileTransportSettings>(); settings.ReadinessTransportSettings.As <FileTransportSettings>().FilePath.Should().Be("readiness.txt"); }
public void Should_load_default_HealthCheck_HOCON() { HealthCheckSettings.DefaultConfig().Should().NotBe(Config.Empty); }