Skip to content

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

Description

@olekihnatowicz
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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions