Skip to content

Commit

Permalink
Add SnapshotStore SaveSnapshot spec from TCK (#271)
Browse files Browse the repository at this point in the history
  • Loading branch information
Arkatufus authored Sep 11, 2024
1 parent 848c8a5 commit 61593d8
Showing 1 changed file with 41 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
using Akka.Configuration;
using Akka.Persistence.TCK.Snapshot;
using Xunit;
using Xunit.Abstractions;

namespace Akka.Persistence.PostgreSql.Tests;

[Collection("PostgreSqlSpec")]
public class PostgreSqlSnapshotStoreSaveSnapshotSpec: SnapshotStoreSaveSnapshotSpec
{
private static Config Initialize(PostgresFixture fixture)
{
//need to make sure db is created before the tests start
DbUtils.Initialize(fixture);

var config = @$"
akka.persistence {{
publish-plugin-commands = on
snapshot-store {{
plugin = ""akka.persistence.snapshot-store.postgresql""
postgresql {{
class = ""Akka.Persistence.PostgreSql.Snapshot.PostgreSqlSnapshotStore, Akka.Persistence.PostgreSql""
plugin-dispatcher = ""akka.actor.default-dispatcher""
table-name = snapshot_store
schema-name = public
auto-initialize = on
connection-string = ""{DbUtils.ConnectionString}""
stored-as = bytea
}}
}}
}}
akka.test.single-expect-default = 10s";

return ConfigurationFactory.ParseString(config);
}

public PostgreSqlSnapshotStoreSaveSnapshotSpec(ITestOutputHelper output, PostgresFixture fixture)
: base(Initialize(fixture), nameof(PostgreSqlSnapshotStoreSaveSnapshotSpec), output: output)
{
}
}

0 comments on commit 61593d8

Please sign in to comment.