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