Skip to content

Commit 684d266

Browse files
authored
Add SnapshotStore SaveSnapshot spec for GridFS from TCK (#387)
1 parent 7395df1 commit 684d266

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
using Akka.Configuration;
2+
using Akka.Persistence.TCK.Snapshot;
3+
using Xunit;
4+
using Xunit.Abstractions;
5+
6+
namespace Akka.Persistence.MongoDb.Tests.GridFS;
7+
8+
[Collection("MongoDbSpec")]
9+
public class MongoDbGridFsSnapshotStoreSaveSnapshotSpec: SnapshotStoreSaveSnapshotSpec, IClassFixture<DatabaseFixture>
10+
{
11+
public MongoDbGridFsSnapshotStoreSaveSnapshotSpec(DatabaseFixture databaseFixture, ITestOutputHelper output)
12+
: base(CreateSpecConfig(databaseFixture), nameof(MongoDbGridFsSnapshotStoreSaveSnapshotSpec), output)
13+
{
14+
}
15+
16+
private static Config CreateSpecConfig(DatabaseFixture databaseFixture)
17+
{
18+
var specString = $$"""
19+
akka.test.single-expect-default = 3s
20+
akka.persistence {
21+
publish-plugin-commands = on
22+
snapshot-store {
23+
plugin = "akka.persistence.snapshot-store.mongodb"
24+
mongodb {
25+
class = "Akka.Persistence.MongoDb.Snapshot.MongoDbGridFsSnapshotStore, Akka.Persistence.MongoDb"
26+
connection-string = "{{databaseFixture.ConnectionString}}"
27+
use-write-transaction = off
28+
auto-initialize = on
29+
collection = "SnapshotStore"
30+
}
31+
}
32+
}
33+
""";
34+
35+
return ConfigurationFactory.ParseString(specString);
36+
}
37+
38+
}

0 commit comments

Comments
 (0)