use of com.google.cloud.spanner.pgadapter.parsers.DateParser in project pgadapter by GoogleCloudPlatform.
the class ParserTest method testDateParsing.
@Test
public void testDateParsing() {
// Google founding date :)
Date value = Date.fromYearMonthDay(1998, 9, 4);
byte[] byteResult = { -1, -1, -2, 28 };
byte[] stringResult = { '1', '9', '9', '8', '-', '0', '9', '-', '0', '4' };
Parser parsedValue = new DateParser(value);
validate(parsedValue, byteResult, stringResult, stringResult);
validateCreateBinary(byteResult, Oid.DATE, value);
validateCreateText(stringResult, Oid.DATE, value);
}
Aggregations