We've got a Spring project that is using the AuditingEntityListener on our JPA entities:
@EntityListeners(AuditingEntityListener.class)
Our base entity has a lastModifiedDate defined as:
@Column(name = "modified_time")
@LastModifiedDate
@Temporal(TemporalType.TIMESTAMP)
private Date lastModifiedDate;
This value is being set automatically when the entity is saved or updated - which is how we'd like the application to behave. We run into issues, though, when we try to set up data in our test suites because in some situations (not all), we'd like to bypass the automatic setting of this field and set the value ourself. In this specific situation, we're trying to order a bunch of test data and then run a test against it.
Is there any way to bypass or turn off the AuditingEntityListener in order to create test data?