Skip to content

@PropertyName is ignored in Shadows creation #574

Closed
@bartoszwalacik

Description

@bartoszwalacik

it causes unexpected nulls in Shadows, reproduction scenario:

class CaseShadowWithPropertyName extends Specification {

    class Entity {
        @Id int id
        @PropertyName("otherField") String someField
    }

    def "should use @PropertyName when creating Shadows"(){
      given:
      def javers = JaversBuilder.javers().build()
      def e = new Entity(id:1, someField: "s")
      javers.commit("author", e)

      when:
      def shadow = javers.findShadows(QueryBuilder.byInstance(e).build()).get(0).get()

      then:
      shadow instanceof Entity
      shadow.id == 1
      shadow.someField == "s"
    }
}

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