mirror of https://github.com/apache/nifi.git
NIFI-5890 Added a unit test that proves that 1.9 fixes a bug in the date conversion behavior in 1.8.
This closes #3214. Signed-off-by: Koji Kawamura <ijokarumawak@apache.org>
This commit is contained in:
parent
1a937b6511
commit
13a7f16860
|
@ -54,6 +54,21 @@ public class TestDataTypeUtils {
|
||||||
assertEquals("Times didn't match", ts.getTime(), sDate.getTime());
|
assertEquals("Times didn't match", ts.getTime(), sDate.getTime());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This was a bug in NiFi 1.8 where converting from a Timestamp to a Date with the record path API
|
||||||
|
* would throw an exception.
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void testTimestampToDate() {
|
||||||
|
java.util.Date date = new java.util.Date();
|
||||||
|
Timestamp ts = DataTypeUtils.toTimestamp(date, null, null);
|
||||||
|
assertNotNull(ts);
|
||||||
|
|
||||||
|
java.sql.Date output = DataTypeUtils.toDate(ts, null, null);
|
||||||
|
assertNotNull(output);
|
||||||
|
assertEquals("Timestamps didn't match", output.getTime(), ts.getTime());
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testConvertRecordMapToJavaMap() {
|
public void testConvertRecordMapToJavaMap() {
|
||||||
assertNull(DataTypeUtils.convertRecordMapToJavaMap(null, null));
|
assertNull(DataTypeUtils.convertRecordMapToJavaMap(null, null));
|
||||||
|
|
Loading…
Reference in New Issue