2727import java .math .BigDecimal ;
2828import java .time .Instant ;
2929import java .time .LocalDateTime ;
30+ import java .time .ZoneOffset ;
3031
3132import static org .junit .jupiter .api .Assertions .assertEquals ;
3233import static org .junit .jupiter .api .Assertions .assertSame ;
@@ -124,28 +125,42 @@ void getStringCellValueOrDefaultThrowable() {
124125 @ Test
125126 void getInstantCellValueOrDefault () {
126127 Instant expectedInstant = Instant .now ();
127- when (row .getInstantCellValue (any ())).thenThrow ( RuntimeException . class );
128- assertSame (expectedInstant , row .getInstantCellValueOrDefault (column , expectedInstant ));
128+ when (row .getInstantCellValue (any ())).thenReturn ( expectedInstant );
129+ assertSame (expectedInstant , row .getInstantCellValueOrDefault (column , Instant . MIN ));
129130 }
130131
131132 @ Test
132133 void getInstantCellValueOrDefaultThrowable () {
133134 Instant expectedInstant = Instant .now ();
134- when (row .getInstantCellValue (any ())).thenReturn ( expectedInstant );
135- assertSame (expectedInstant , row .getInstantCellValueOrDefault (column , Instant . MIN ));
135+ when (row .getInstantCellValue (any ())).thenThrow ( RuntimeException . class );
136+ assertSame (expectedInstant , row .getInstantCellValueOrDefault (column , expectedInstant ));
136137 }
137138
138139 @ Test
139140 void getLocalDateTimeCellValueOrDefault () {
141+ LocalDateTime expectedLocalDateTime = LocalDateTime .now ();
142+ when (row .getLocalDateTimeCellValue (any ())).thenReturn (expectedLocalDateTime );
143+ assertSame (expectedLocalDateTime , row .getLocalDateTimeCellValueOrDefault (column , LocalDateTime .MIN ));
144+ }
145+
146+ @ Test
147+ void getLocalDateTimeCellValueOrDefaultThrowable () {
140148 LocalDateTime expectedLocalDateTime = LocalDateTime .now ();
141149 when (row .getLocalDateTimeCellValue (any ())).thenThrow (RuntimeException .class );
142150 assertSame (expectedLocalDateTime , row .getLocalDateTimeCellValueOrDefault (column , expectedLocalDateTime ));
143151 }
144152
145153 @ Test
146- void getLocalDateTimeCellValueOrDefaultThrowable () {
154+ void getLocalDateTimeCellValueOnZoneIdOrDefault () {
147155 LocalDateTime expectedLocalDateTime = LocalDateTime .now ();
148- when (row .getLocalDateTimeCellValue (any ())).thenReturn (expectedLocalDateTime );
149- assertSame (expectedLocalDateTime , row .getLocalDateTimeCellValueOrDefault (column , LocalDateTime .MIN ));
156+ when (row .getLocalDateTimeCellValue (any (), any ())).thenReturn (expectedLocalDateTime );
157+ assertSame (expectedLocalDateTime , row .getLocalDateTimeCellValueOrDefault (column , ZoneOffset .UTC , LocalDateTime .MIN ));
158+ }
159+
160+ @ Test
161+ void getLocalDateTimeCellValueOnZoneIdOrDefaultThrowable () {
162+ LocalDateTime expectedLocalDateTime = LocalDateTime .now ();
163+ when (row .getLocalDateTimeCellValue (any (), any ())).thenThrow (RuntimeException .class );
164+ assertSame (expectedLocalDateTime , row .getLocalDateTimeCellValueOrDefault (column , ZoneOffset .UTC , expectedLocalDateTime ));
150165 }
151166}
0 commit comments