Skip to content

Commit 2ba36cc

Browse files
committed
Minor test tweaks
1 parent a2a7930 commit 2ba36cc

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

flight/flight-sql-jdbc-core/src/test/java/org/apache/arrow/driver/jdbc/accessor/impl/calendar/ArrowFlightJdbcTimeStampVectorAccessorTest.java

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,10 @@ public void testShouldGetObjectReturnValidLocalDateTime(
215215
vector,
216216
(accessor, currentRow) -> {
217217
final LocalDateTime value = accessor.getObject(LocalDateTime.class);
218+
final LocalDateTime expectedValue =
219+
getZonedDateTime(currentRow, expectedTimeZone).toLocalDateTime();
218220

219-
assertThat(
220-
value, equalTo(getZonedDateTime(currentRow, expectedTimeZone).toLocalDateTime()));
221+
assertThat(value, equalTo(expectedValue));
221222
assertThat(accessor.wasNull(), is(false));
222223
});
223224
}
@@ -234,8 +235,9 @@ public void testShouldGetObjectReturnValidInstant(
234235
vector,
235236
(accessor, currentRow) -> {
236237
final Instant value = accessor.getObject(Instant.class);
238+
final Instant expectedValue = getZonedDateTime(currentRow, expectedTimeZone).toInstant();
237239

238-
assertThat(value, equalTo(getZonedDateTime(currentRow, expectedTimeZone).toInstant()));
240+
assertThat(value, equalTo(expectedValue));
239241
assertThat(accessor.wasNull(), is(false));
240242
});
241243
}
@@ -252,10 +254,11 @@ public void testShouldGetObjectReturnValidOffsetDateTime(
252254
vector,
253255
(accessor, currentRow) -> {
254256
final OffsetDateTime value = accessor.getObject(OffsetDateTime.class);
255-
final OffsetDateTime vectorValue =
257+
final OffsetDateTime expectedValue =
256258
getZonedDateTime(currentRow, expectedTimeZone).toOffsetDateTime();
257-
assertThat(value, equalTo(vectorValue));
258-
assertThat(value.getOffset(), equalTo(vectorValue.getOffset()));
259+
260+
assertThat(value, equalTo(expectedValue));
261+
assertThat(value.getOffset(), equalTo(expectedValue.getOffset()));
259262
assertThat(accessor.wasNull(), is(false));
260263
});
261264
}
@@ -272,8 +275,9 @@ public void testShouldGetObjectReturnValidZonedDateTime(
272275
vector,
273276
(accessor, currentRow) -> {
274277
final ZonedDateTime value = accessor.getObject(ZonedDateTime.class);
278+
final ZonedDateTime expectedValue = getZonedDateTime(currentRow, expectedTimeZone);
275279

276-
assertThat(value, equalTo(getZonedDateTime(currentRow, expectedTimeZone)));
280+
assertThat(value, equalTo(expectedValue));
277281
assertThat(value.getZone(), equalTo(ZoneId.of(expectedTimeZone)));
278282
assertThat(accessor.wasNull(), is(false));
279283
});

0 commit comments

Comments
 (0)