Skip to content

Commit

Permalink
Fixed a issue where akka.persistence.query.plugin wasn't set for defa…
Browse files Browse the repository at this point in the history
…ult journal (#43)
  • Loading branch information
MattiasJakobsson authored Jun 24, 2024
1 parent b0c086e commit 2cafe1f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,18 @@ public void DefaultOptionsTest()

var actualConfig = opt.ToConfig().WithFallback(EventStorePersistence.DefaultConfiguration);

actualConfig = actualConfig.GetConfig(EventStorePersistence.JournalConfigPath);
var actualPluginConfig = actualConfig.GetConfig(EventStorePersistence.JournalConfigPath);

actualConfig.GetString("connection-string").Should().Be(defaultConfig.GetString("connection-string"));
actualConfig.GetString("adapter").Should().Be(defaultConfig.GetString("adapter"));
actualConfig.GetString("prefix").Should().Be(defaultConfig.GetString("prefix"));
actualConfig.GetString("tagged-stream-name-pattern").Should().Be(defaultConfig.GetString("tagged-stream-name-pattern"));
actualConfig.GetString("persistence-ids-stream-name").Should().Be(defaultConfig.GetString("persistence-ids-stream-name"));
actualConfig.GetString("persisted-events-stream-name").Should().Be(defaultConfig.GetString("persisted-events-stream-name"));
actualConfig.GetString("tenant").Should().Be(defaultConfig.GetString("tenant"));
actualConfig.GetString("materializer-dispatcher").Should()
actualPluginConfig.GetString("connection-string").Should().Be(defaultConfig.GetString("connection-string"));
actualPluginConfig.GetString("adapter").Should().Be(defaultConfig.GetString("adapter"));
actualPluginConfig.GetString("prefix").Should().Be(defaultConfig.GetString("prefix"));
actualPluginConfig.GetString("tagged-stream-name-pattern").Should().Be(defaultConfig.GetString("tagged-stream-name-pattern"));
actualPluginConfig.GetString("persistence-ids-stream-name").Should().Be(defaultConfig.GetString("persistence-ids-stream-name"));
actualPluginConfig.GetString("persisted-events-stream-name").Should().Be(defaultConfig.GetString("persisted-events-stream-name"));
actualPluginConfig.GetString("tenant").Should().Be(defaultConfig.GetString("tenant"));
actualPluginConfig.GetString("materializer-dispatcher").Should()
.Be(defaultConfig.GetString("materializer-dispatcher"));
actualConfig.GetString("akka.persistence.query.plugin").Should().Be(EventStorePersistence.QueryConfigPath);
}

[Fact(DisplayName = "Custom Options should modify default config")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ protected override StringBuilder Build(StringBuilder sb)

sb.AppendLine("}");

if (IsDefaultPlugin)
sb.AppendLine($"akka.persistence.query.plugin = {QueryPluginId}");

return sb;
}
}

0 comments on commit 2cafe1f

Please sign in to comment.