Example usage for org.hibernate.envers DefaultRevisionEntity setTimestamp

List of usage examples for org.hibernate.envers DefaultRevisionEntity setTimestamp

Introduction

In this page you can find the example usage for org.hibernate.envers DefaultRevisionEntity setTimestamp.

Prototype

public void setTimestamp(long timestamp) 

Source Link

Usage

From source file:org.springframework.data.envers.repository.support.DefaultRevisionMetadataUnitTests.java

License:Apache License

@Test // #112
public void createsLocalDateTimeFromTimestamp() {

    DefaultRevisionEntity entity = new DefaultRevisionEntity();
    entity.setTimestamp(NOW.toEpochMilli());

    DefaultRevisionMetadata metadata = new DefaultRevisionMetadata(entity);

    assertThat(metadata.getRevisionDate()).hasValue(LocalDateTime.ofInstant(NOW, ZoneOffset.systemDefault()));
}