Skip to content

Commit 0dab5e9

Browse files
committed
update table-wrapper-api
1 parent b2fafdc commit 0dab5e9

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
<dependency>
7373
<groupId>com.github.spacious-team</groupId>
7474
<artifactId>table-wrapper-api</artifactId>
75-
<version>5bf417e424</version>
75+
<version>26e4fbf382</version>
7676
</dependency>
7777
<dependency>
7878
<groupId>com.univocity</groupId>

src/test/java/org/spacious_team/table_wrapper/csv/CsvTableCellTest.java

+19
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,25 @@ void getLocalDateTimeValue(String dateTime) {
190190
assertEquals(expected, cell.getLocalDateTimeValue());
191191
}
192192

193+
@ParameterizedTest
194+
@ValueSource(strings = {"2022-10-11 03:01:00", "03:01:00 11-10-2022", "11 10 2022 03:01:00",
195+
"03:01:00 2022/10/11", "11.10.2022 03:01:00"})
196+
void getLocalDateTimeValue_withZoneId(String dateTime) {
197+
LocalDateTime expected = LocalDate.of(2022, 10, 11)
198+
.atTime(3, 1);
199+
String[] row = new String[]{dateTime};
200+
TableCell cell = CsvTableCell.of(row, 0);
201+
int offsetSeconds = ZoneId.systemDefault()
202+
.getRules()
203+
.getOffset(expected)
204+
.getTotalSeconds();
205+
ZoneId zoneIdPlusHour = ZoneOffset.ofTotalSeconds(offsetSeconds + 3600);
206+
207+
assertEquals(expected, cell.getLocalDateTimeValue());
208+
assertEquals(expected, cell.getLocalDateTimeValue(ZoneOffset.systemDefault()));
209+
assertEquals(expected.plusHours(1), cell.getLocalDateTimeValue(zoneIdPlusHour));
210+
}
211+
193212
@Test
194213
void createWithCellDataAccessObject() {
195214
CsvTableCell cell = (CsvTableCell) CsvTableCell.of(new String[]{"test"}, 0);

0 commit comments

Comments
 (0)