Skip to content

findShadows query with exact commitId returns shadows for other commits if non-existing commitId is given #660

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

Closed
olekihnatowicz opened this issue Apr 11, 2018 · 3 comments

Comments

@olekihnatowicz
Copy link

def "should return exact commit for query with commitId"() {
    given:
        def ref1 = new SnapshotEntity(id: 2)
        def ref2 = new SnapshotEntity(id: 3)
        javers.commit("a", ref1)
        javers.commit("a", ref2)

        def entity = new SnapshotEntity(id: 1, listOfEntities: [ref1,ref2])
        javers.commit("a", entity)

    when:
        def shadows = javers.findShadows(
                        byInstanceId(1, SnapshotEntity)
                        .withScopeDeepPlus(1)
                        .withCommitId(CommitId.valueOf("543434.0")) //non-existing commitId
                        .build())
                .collect{it.get()}

    then:
        shadows.size() == 0
}

This test fails since javers version 3.7.5

olekihnatowicz pushed a commit to olekihnatowicz/javers that referenced this issue Apr 11, 2018
@olekihnatowicz
Copy link
Author

@bartoszwalacik
Copy link
Member

thanks for reporting

bartoszwalacik added a commit that referenced this issue Apr 22, 2018
@bartoszwalacik
Copy link
Member

Fix released in 3.9.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants