New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add local version field in snapshots #294
Conversation
@@ -26,6 +26,7 @@ | |||
private final CdoSnapshotState state; | |||
private final SnapshotType type; | |||
private final List<String> changed; | |||
private final Long version; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Think we dont want version to be null, so maybe primitive long?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I'll change that. Do you prefer for me to simply commit this change or to squash it with the previous (I didn't find contribution guidelines)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, we need to write contribution guidelines. Just push another commit but wait a while, i will take a deeper look at this PR at the evening
@@ -41,6 +40,7 @@ class CdoSnapshotTypeAdapterTest extends Specification { | |||
json.globalId.entity == "org.javers.core.model.DummyUser" | |||
json.globalId.cdoId == "kaz" | |||
json.type == "INITIAL" | |||
json.version == 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest to test it in a different (minimal) way.
So test new version field only in 2 basic tests:
def "should serialize CdoSnapshot to Json"()
and
def "should deserialize CdoSnapshot"()
and not to change other tests.
Deserializer should not break if field is missing (and it will be missing if users ugrade to new JaVers version and will load snapshots created in old JaVers version).
…dy existing snapshots databases
I did fixes on my branch, and just merged all into master |
released in 1.4.4 |
I'm happy to accept any comments, suggestions, etc :)