|
16 | 16 | package org.springframework.data.jdbc.core.convert;
|
17 | 17 |
|
18 | 18 | import static org.assertj.core.api.Assertions.*;
|
| 19 | +import static org.assertj.core.api.SoftAssertions.*; |
19 | 20 | import static org.mockito.Mockito.*;
|
20 | 21 |
|
21 | 22 | import lombok.Data;
|
|
26 | 27 | import java.time.LocalDate;
|
27 | 28 | import java.time.LocalDateTime;
|
28 | 29 | import java.time.LocalTime;
|
| 30 | +import java.time.OffsetDateTime; |
29 | 31 | import java.time.ZoneOffset;
|
30 | 32 | import java.time.ZonedDateTime;
|
31 | 33 | import java.util.Date;
|
@@ -69,12 +71,14 @@ public void testTargetTypesForPropertyType() {
|
69 | 71 | SoftAssertions softly = new SoftAssertions();
|
70 | 72 |
|
71 | 73 | checkTargetType(softly, entity, "someEnum", String.class);
|
72 |
| - checkTargetType(softly, entity, "localDateTime", Timestamp.class); |
| 74 | + checkTargetType(softly, entity, "localDateTime", LocalDateTime.class); |
73 | 75 | checkTargetType(softly, entity, "localDate", Timestamp.class);
|
74 | 76 | checkTargetType(softly, entity, "localTime", Timestamp.class);
|
| 77 | + checkTargetType(softly, entity, "zonedDateTime", String.class); |
| 78 | + checkTargetType(softly, entity, "offsetDateTime", OffsetDateTime.class); |
75 | 79 | checkTargetType(softly, entity, "instant", Timestamp.class);
|
76 | 80 | checkTargetType(softly, entity, "date", Date.class);
|
77 |
| - checkTargetType(softly, entity, "zonedDateTime", String.class); |
| 81 | + checkTargetType(softly, entity, "timestamp", Timestamp.class); |
78 | 82 | checkTargetType(softly, entity, "uuid", UUID.class);
|
79 | 83 |
|
80 | 84 | softly.assertAll();
|
@@ -116,7 +120,7 @@ void conversionOfDateLikeValueAndBackYieldsOriginalValue() {
|
116 | 120 |
|
117 | 121 | RelationalPersistentEntity<?> persistentEntity = context.getRequiredPersistentEntity(DummyEntity.class);
|
118 | 122 |
|
119 |
| - SoftAssertions.assertSoftly(softly -> { |
| 123 | + assertSoftly(softly -> { |
120 | 124 | LocalDateTime testLocalDateTime = LocalDateTime.of(2001, 2, 3, 4, 5, 6, 123456789);
|
121 | 125 | checkConversionToTimestampAndBack(softly, persistentEntity, "localDateTime", testLocalDateTime);
|
122 | 126 | checkConversionToTimestampAndBack(softly, persistentEntity, "localDate", LocalDate.of(2001, 2, 3));
|
@@ -165,9 +169,11 @@ private static class DummyEntity {
|
165 | 169 | private final LocalDateTime localDateTime;
|
166 | 170 | private final LocalDate localDate;
|
167 | 171 | private final LocalTime localTime;
|
| 172 | + private final ZonedDateTime zonedDateTime; |
| 173 | + private final OffsetDateTime offsetDateTime; |
168 | 174 | private final Instant instant;
|
169 | 175 | private final Date date;
|
170 |
| - private final ZonedDateTime zonedDateTime; |
| 176 | + private final Timestamp timestamp; |
171 | 177 | private final AggregateReference<DummyEntity, Long> reference;
|
172 | 178 | private final UUID uuid;
|
173 | 179 |
|
|
0 commit comments