import Ġch . tut tel i . at rium . api . fluent . en _ GB . toBe The Instance Ċ import Ġch . tut tel i . at rium . api . fluent . en _ GB . toEqual Ċ import Ġch . tut tel i . at rium . api . ver bs . expect Ċ import Ġk lite . jdbc . Jdbc Converter Ċ import Ġorg . junit . jupiter . api . Test Ċ import Ġjava . sql . Date Ċ import Ġjava . sql . Timestamp Ċ import Ġjava . time .* Ċ import Ġjava . time . Zone Offset . UTC Ċ import Ġjava . util .* Ċ Ċ class ĠJdbc Converter Test Ġ{ ĊĠ Ġ@ Test Ġfun Ġ` null `() Ġ{ ĊĠĠĠ Ġexpect ( Jdbc Converter . to ( null )). toEqual ( null ) ĊĠ Ġ} ĊĊĠ Ġ@ Test Ġfun Ġ` primitive Ġtypes Ġare Ġsupported Ġby Ġjdbc `() Ġ{ ĊĠĠĠ Ġexpect ( Jdbc Converter . to ( 1 2 3 )). toEqual ( 1 2 3 ) ĊĠĠĠ Ġexpect ( Jdbc Converter . to ( 1 2 3 L )). toEqual ( 1 2 3 L ) ĊĠĠĠ Ġexpect ( Jdbc Converter . to ( 1 2 3 . 0 )). toEqual ( 1 2 3 . 0 ) ĊĠ Ġ} ĊĊĠ Ġ@ Test Ġfun Ġ` BigInteger Ġand ĠBigDecimal `() Ġ{ ĊĠĠĠ Ġexpect ( Jdbc Converter . to ( 1 2 3 . to BigDecimal ())). toEqual ( 1 2 3 . to BigDecimal ()) ĊĠĠĠ Ġexpect ( Jdbc Converter . to ( 1 2 3 . to BigInteger ())). toEqual ( 1 2 3 . to BigInteger ()) ĊĠ Ġ} ĊĊĠ Ġ@ Test Ġfun Ġ` to Ġlocal Ġdate Ġand Ġtime `() Ġ{ ĊĠĠĠ Ġexpect ( Jdbc Converter . to ( LocalDate . of ( 2 0 2 1 , Ġ 1 0 , Ġ 2 1 ))). toEqual ( LocalDate . of ( 2 0 2 1 , Ġ 1 0 , Ġ 2 1 )) ĊĠĠĠ Ġexpect ( Jdbc Converter . to ( LocalDateTime . MIN )). toBe The Instance ( LocalDateTime . MIN ) ĊĠĠĠ Ġexpect ( Jdbc Converter . to ( Local Time . MIN )). toBe The Instance ( Local Time . MIN ) ĊĠĠĠ Ġexpect ( Jdbc Converter . to ( Offset DateTime . MIN )). toBe The Instance ( Offset DateTime . MIN ) ĊĠ Ġ} ĊĊĠ Ġ@ Test Ġfun Ġ` from Ġlocal Ġdate Ġand Ġtime `() Ġ{ ĊĠĠĠ Ġexpect ( Jdbc Converter . from ( Date ( 1 2 3 ), ĠLocalDate :: class )). toEqual ( LocalDate . of ( 1 9 7 0 , Ġ 1 , Ġ 1 )) ĊĠĠĠ Ġexpect ( Jdbc Converter . from ( Timestamp ( 1 2 3 ), ĠInstant :: class )). toEqual ( Instant . of Epoch Milli ( 1 2 3 )) ĊĠĠĠ Ġexpect ( Jdbc Converter . from ( Timestamp ( 1 2 3 ), ĠLocalDateTime :: class )). toEqual ( Timestamp ( 1 2 3 ). to LocalDateTime ()) ĊĠĠĠ Ġexpect ( Jdbc Converter . from ( null , ĠLocalDateTime :: class )). toEqual ( null ) ĊĠĠĠ Ġexpect ( Jdbc Converter . from ( null , ĠInstant :: class )). toEqual ( null ) ĊĠ Ġ} ĊĊĠ Ġ@ Test Ġfun Ġ` Instant Ġshould Ġbe Ġconverted Ġto Ġoffset `() Ġ{ ĊĠĠĠ Ġexpect ( Jdbc Converter . to ( Instant . EPOCH )). toEqual ( Instant . EPOCH . at Offset ( UTC )) ĊĠ Ġ} ĊĊĠ Ġ@ Test Ġfun Ġ` toString Ġtypes `() Ġ{ ĊĠĠĠ Ġexpect ( Jdbc Converter . to ( Currency . getInstance (" EUR ")) ). toEqual (" EUR ") ĊĠĠĠ Ġexpect ( Jdbc Converter . to ( Locale (" et ")) ). toEqual (" et ") ĊĠĠĠ Ġexpect ( Jdbc Converter . to ( Period . of Days ( 3 ))). toEqual (" P 3 D ") ĊĠ Ġ} ĊĊĠ Ġ@ Test Ġfun Ġ` from ĠtoString Ġtypes `() Ġ{ ĊĠĠĠ Ġexpect ( Jdbc Converter . from (" EUR ", ĠCurrency :: class )). toEqual ( Currency . getInstance (" EUR ")) ĊĠĠĠ Ġexpect ( Jdbc Converter . from (" et ", ĠLocale :: class )). toEqual ( Locale (" et ")) ĊĠĠĠ Ġexpect ( Jdbc Converter . from (" P 3 D ", ĠPeriod :: class )). toEqual ( Period . of Days ( 3 )) ĊĠ Ġ} Ċ } Ċ