Skip to content

Commit

Permalink
[hotfix] [core] Assert current serializer snapshot is expected snapsh…
Browse files Browse the repository at this point in the history
…ot class in TypeSerializerSnapshotMigrationTestBase

This strengthens the test base to make use of the provided snapshot
class in the test specifications, to assert that serializers are really
using the expected classes for their current serializer snapshots.
  • Loading branch information
tzulitai committed Jan 8, 2019
1 parent 301be55 commit 25dc483
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ public void movingForward() throws IOException {
TypeSerializer<ElementT> restoredSerializer = previousSnapshot.restoreSerializer();

TypeSerializerSnapshot<ElementT> nextSnapshot = restoredSerializer.snapshotConfiguration();
assertThat(nextSnapshot, instanceOf(testSpecification.snapshotClass));

TypeSerializerSnapshot<ElementT> nextSnapshotDeserialized = writeAndThenReadTheSnapshot(restoredSerializer, nextSnapshot);

assertThat(nextSnapshotDeserialized, allOf(
Expand Down Expand Up @@ -247,6 +249,10 @@ private Path getSnapshotDataLocation() {
return resourcePath(this.snapshotDataLocation);
}

public Class<? extends TypeSerializerSnapshot<T>> getSnapshotClass() {
return snapshotClass;
}

@Override
public String toString() {
return String.format("%s , %s, %s", name, serializerType.getSimpleName(), snapshotClass.getSimpleName());
Expand Down

0 comments on commit 25dc483

Please sign in to comment.