-
Bug
-
Resolution: Fixed
-
P4
-
8, 9
-
b08
LocalTime has a nano-of-second value with Time does not. So if you ran the following
@Test
public void test14() {
LocalTime lt = LocalTime.now();
//LocalTime lt = LocalTime.of(8, 30, 59);
Time t = Time.valueOf(lt);
assertTrue(lt.equals(t.toLocalTime()),
"Error LocalTime values are not equal");
}
The assertion would fail.
if you use the LocalTime.of() method (which is what Time.toLocalTime() calls), the test will pass. The javadoc for LocalTime.of indicates that the nanos is set to zero.
@Test
public void test14() {
LocalTime lt = LocalTime.now();
//LocalTime lt = LocalTime.of(8, 30, 59);
Time t = Time.valueOf(lt);
assertTrue(lt.equals(t.toLocalTime()),
"Error LocalTime values are not equal");
}
The assertion would fail.
if you use the LocalTime.of() method (which is what Time.toLocalTime() calls), the test will pass. The javadoc for LocalTime.of indicates that the nanos is set to zero.