Skip to content

Add new change types for properties on subclassing#830

Merged
bartoszwalacik merged 12 commits intojavers:masterfrom
franktominc:master
May 17, 2019
Merged

Add new change types for properties on subclassing#830
bartoszwalacik merged 12 commits intojavers:masterfrom
franktominc:master

Conversation

@franktominc
Copy link
Contributor

No description provided.

@franktominc
Copy link
Contributor Author

Moved from #825

@franktominc
Copy link
Contributor Author

franktominc commented Apr 22, 2019

There are some failing tests here that I'm not sure how to fix. It seems to be using ListChangeAppender to calculate the changes between a list and another class instance. It tries to convert the class instance to a list and fails with a ClassCastException.

The tests in question are:

org.javers.repository.mongo.EmbeddedMongoE2EWithRandomGeneratorTest/org.javers.core.JaversRepositoryE2ETest#should allow for property type change

org.javers.repository.mongo.EmbeddedMongoE2ETest/org.javers.core.JaversRepositoryE2ETest#should allow for property type change

Can you help me with those?

@bartoszwalacik
Copy link
Member

huge PR :) give me a while

@franktominc
Copy link
Contributor Author

No worries, take your time :)

@bartoszwalacik
Copy link
Member

there are two problems with this PR

  • You didn't provided tests for the new feature, so we don't know how it works and if it works.
  • You have changed some existing tests which should not be affected by this change. For example, there is no reason to change SnapshotDifferIntegrationTest.groovy or JaversNapCategoryTreeIntegrationTest.groovy. The more tests you change, the higher risk that you break existing code of Javers users

@franktominc
Copy link
Contributor Author

Regarding your points:

  • I'll write some tests for it, however I'm afraid my groovy isn't that sharp, I'll try my best.
  • The problem with the tests you mentioned was that they were testing for class equality, and this PR indeed broke some things. Now both ValueChange and ReferenceChange are abstract classes and each one of them has a final class for the added, updated and removed change.

Before the change:

Imgur

After the change:

Imgur

I updated those tests to reflect this change.

bartoszwalacik added a commit that referenced this pull request May 9, 2019
bartoszwalacik added a commit that referenced this pull request May 10, 2019
bartoszwalacik added a commit that referenced this pull request May 10, 2019
bartoszwalacik added a commit that referenced this pull request May 10, 2019
@bartoszwalacik bartoszwalacik merged commit 8d694c0 into javers:master May 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants