Guest implements Serializable { @XmlTransient @Transient public LocalDateTime getLastUpdate() { if (null == lastUpdateTimestamp) { return null; } return LocalDateTime.from(lastUpdateTimestamp.toInstant().atZone(of(UTC.getId()))); } Guest();  Guest(@NotNull String publicId, @NotNull String name, String email); String getPublicId(); void setPublicId(String publicId); String getName(); void setName(String name); String getEmail(); void setEmail(String email); Long getId(); void setId(Long id); Long getVersion(); void setVersion(Long version); @XmlTransient @Transient LocalDateTime getLastUpdate(); void setLastUpdate(LocalDateTime lastUpdate); @Override String toString(); static Guest nullGuest(); static final String GUEST_FIND_BY_PUBLIC_ID; static final String GUEST_FIND_BY_NAME; }
@Test public void persisting_a_guest_sets_the_last_update_field() { Guest guest = new Guest("", "", ""); new Audit().setAuditFields(guest); assertThat(guest.getLastUpdate()).isNotNull(); }