-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Snapshot Metadata timestamp support
- Loading branch information
Showing
2 changed files
with
90 additions
and
2 deletions.
There are no files selected for viewing
63 changes: 63 additions & 0 deletions
63
src/Akka.Persistence.Redis.Tests/RedisSnapshotStoreSaveSnapshotSpec.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
// ----------------------------------------------------------------------- | ||
// <copyright file="RedisSnapshotStoreSaveSnapshotSpec.cs" company="Akka.NET Project"> | ||
// Copyright (C) 2013-2021 .NET Foundation <https://github.com/akkadotnet/akka.net> | ||
// </copyright> | ||
// ----------------------------------------------------------------------- | ||
|
||
using Akka.Configuration; | ||
using Akka.Persistence.TCK.Snapshot; | ||
using Xunit; | ||
using Xunit.Abstractions; | ||
|
||
#nullable enable | ||
namespace Akka.Persistence.Redis.Tests; | ||
|
||
[Collection("RedisSpec")] | ||
public class RedisSnapshotStoreSaveSnapshotSpec: SnapshotStoreSaveSnapshotSpec | ||
{ | ||
public const int Database = 1; | ||
|
||
public static Config Config(RedisFixture fixture, int id) | ||
{ | ||
DbUtils.Initialize(fixture); | ||
|
||
return ConfigurationFactory.ParseString($@" | ||
akka.test.single-expect-default = 3s | ||
akka.persistence {{ | ||
publish-plugin-commands = on | ||
snapshot-store {{ | ||
plugin = ""akka.persistence.snapshot-store.redis"" | ||
redis {{ | ||
class = ""Akka.Persistence.Redis.Snapshot.RedisSnapshotStore, Akka.Persistence.Redis"" | ||
configuration-string = ""{fixture.ConnectionString}"" | ||
plugin-dispatcher = ""akka.actor.default-dispatcher"" | ||
database = ""{id}"" | ||
}} | ||
}} | ||
}} | ||
akka.actor {{ | ||
serializers {{ | ||
persistence-snapshot = ""Akka.Persistence.Redis.Serialization.PersistentSnapshotSerializer, Akka.Persistence.Redis"" | ||
}} | ||
serialization-bindings {{ | ||
""Akka.Persistence.SelectedSnapshot, Akka.Persistence"" = persistence-snapshot | ||
}} | ||
serialization-identifiers {{ | ||
""Akka.Persistence.Redis.Serialization.PersistentSnapshotSerializer, Akka.Persistence.Redis"" = 48 | ||
}} | ||
}}").WithFallback(RedisPersistence.DefaultConfig()); | ||
} | ||
|
||
public RedisSnapshotStoreSaveSnapshotSpec(ITestOutputHelper output, RedisFixture fixture) | ||
: base(Config(fixture, Database), nameof(RedisSnapshotStoreSpec), output) | ||
{ | ||
RedisPersistence.Get(Sys); | ||
} | ||
|
||
protected override void AfterAll() | ||
{ | ||
base.AfterAll(); | ||
DbUtils.Clean(Database); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters