package org.javersion.object;

import static org.assertj.core.api.Assertions.*;

import java.time.Instant;
import java.time.LocalDate;
import java.time.LocalDateTime;

import org.junit.Test;

public class JavaTimeTest {

    @Versionable
    public static class DT {
        final Instant instant = Instant.now();
        final LocalDate localDate = LocalDate.now();
        final LocalDateTime localDateTime = LocalDateTime.now();
    }

    private ObjectSerializer<DT> serializer = new ObjectSerializer<>(DT.class);

    @Test
    public void write_read() {
        final DT dt = new DT();
        DT dtCopy = serializer.fromPropertyMap(serializer.toPropertyMap(dt));
        assertThat(dtCopy.instant).isEqualTo(dt.instant);
        assertThat(dtCopy.localDate).isEqualTo(dt.localDate);
        assertThat(dtCopy.localDateTime).isEqualTo(dt.localDateTime);
    }

}

@@ -264,24 +264,32 @@
 T %7B%0A        
+private 
 final Instan
@@ -315,32 +315,40 @@
 .now();%0A        
+private 
 final LocalDate 
@@ -380,24 +380,32 @@
 ();%0A        
+private 
 final LocalD
@@ -884,11 +884,10 @@
 ;%0A    %7D%0A
-%0A
 %7D%0A

Verify binding of private final fields