Binders { public static Binder timeBinder() { return TIME_BINDER; } private  Binders(); static Binder defaultBinder(); static Binder stringBinder(); static Binder dateBinder(); static Binder timestampBinder(); static Binder timeBinder(); static Binder decimalBinder(); static Binder integerBinder();  }
@Test public void timeBinderBindsTime() throws SQLException { Time time = Time.valueOf("13:14:15"); Binder binder = Binders.timeBinder(); binder.bind(stmt, 1, time); verify(stmt).setTime(1, time); }
@Test public void timeBinderBindsUtilDate() throws SQLException { Time time = Time.valueOf("13:14:15"); Binder binder = Binders.timeBinder(); binder.bind(stmt, 1, new java.util.Date(time.getTime())); verify(stmt).setTime(1, time); }
@Test public void timeBinderBindsCalendar() throws SQLException { Time time = Time.valueOf("13:14:15"); Calendar calendar = Calendar.getInstance(); calendar.setTimeInMillis(time.getTime()); Binder binder = Binders.timeBinder(); binder.bind(stmt, 1, calendar); verify(stmt).setTime(1, time, calendar); }
@Test public void timeBinderBindsString() throws SQLException { Binder binder = Binders.timeBinder(); binder.bind(stmt, 1, "13:14:15"); verify(stmt).setTime(1, Time.valueOf("13:14:15")); }
@Test public void timeBinderBindsLocalTime() throws SQLException { Binder binder = Binders.timeBinder(); binder.bind(stmt, 1, LocalTime.parse("01:02:03.000")); verify(stmt).setTime(1, Time.valueOf("01:02:03")); }
@Test public void timeBinderBindsOffsetTime() throws SQLException { Binder binder = Binders.timeBinder(); binder.bind(stmt, 1, OffsetTime.of(LocalTime.parse("01:02:03.000"), ZoneOffset.UTC)); verify(stmt).setTime(eq(1), eq(Time.valueOf("01:02:03")), calendarWithTimeZone(TimeZone.getTimeZone(ZoneOffset.UTC))); }
@Test public void timeBinderBindsNull() throws SQLException { Binder binder = Binders.timeBinder(); binder.bind(stmt, 1, null); verify(stmt).setObject(1, null); }
@Test public void timeBinderBindsObject() throws SQLException { Binder binder = Binders.timeBinder(); binder.bind(stmt, 1, Boolean.TRUE); verify(stmt).setObject(1, Boolean.TRUE); }