Skip to content

Commit

Permalink
use real ReplicatorSettings
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaronontheweb committed Nov 6, 2024
1 parent 18bdbbb commit 7eeea2e
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/Akka.Cluster.Hosting.Tests/DDataOptionsSpecs.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
using System.Threading.Tasks;
using Akka.Actor;
using Akka.Cluster.Sharding;
using Akka.DistributedData;
using Akka.Hosting;
using FluentAssertions;
using Microsoft.Extensions.DependencyInjection;
using Xunit;
using Xunit.Abstractions;
Expand Down Expand Up @@ -43,17 +45,19 @@ public DDataOptionsSpecs(ITestOutputHelper output)
public async Task Should_not_emit_durable_keys_when_empty(DDataOptions options)
{
// arrange
using var host = await TestHelper.CreateHost(builder => { builder.WithDistributedData(options); },
using var host = await TestHelper.CreateHost(builder =>
{
builder
.WithDistributedData(options);
},
new ClusterOptions() { Roles = new[] { "my-host" } }, Output);

var actorSystem = host.Services.GetRequiredService<ActorSystem>();

// act
var config = actorSystem.Settings.Config.GetConfig("akka.cluster.distributed-data");
var ddataSettings = ReplicatorSettings.Create(actorSystem); // parse the settings

// assert
Assert.True(config.HasPath("durable.keys"));
var keys = config.GetStringList("durable.keys");
Assert.Empty(keys);
ddataSettings.DurableKeys.Should().BeEmpty();
}
}

0 comments on commit 7eeea2e

Please sign in to comment.