mirror of https://github.com/apache/nifi.git
NIFI-3718: Fixed TestAvroRecordReader to handle timezone differences
This closes #1683
This commit is contained in:
parent
b93cf7bbdb
commit
141334c3c9
|
@ -83,7 +83,7 @@ public class TestAvroRecordReader {
|
|||
record.put("timeMicros", millisSinceMidnight * 1000L);
|
||||
record.put("timestampMillis", timeLong);
|
||||
record.put("timestampMicros", timeLong * 1000L);
|
||||
record.put("date", 17261);
|
||||
record.put("date", 17260);
|
||||
|
||||
writer.append(record);
|
||||
writer.flush();
|
||||
|
@ -106,7 +106,9 @@ public class TestAvroRecordReader {
|
|||
assertEquals(new java.sql.Time(millisSinceMidnight), record.getValue("timeMicros"));
|
||||
assertEquals(new java.sql.Timestamp(timeLong), record.getValue("timestampMillis"));
|
||||
assertEquals(new java.sql.Timestamp(timeLong), record.getValue("timestampMicros"));
|
||||
assertEquals(new java.sql.Date(timeLong).toString(), record.getValue("date").toString());
|
||||
final DateFormat noTimeOfDayDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||
noTimeOfDayDateFormat.setTimeZone(TimeZone.getTimeZone("gmt"));
|
||||
assertEquals(new java.sql.Date(timeLong).toString(), noTimeOfDayDateFormat.format(record.getValue("date")));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue