Use the same format when comparing the error messages containing date fields (#37006)

Test fix: make sure the format in which we check the date is the same as the one we used to format the initial JDBC date field.
This commit is contained in:
Andrei Stefan 2018-12-31 13:41:54 +02:00 committed by GitHub
parent fd7cde88db
commit 9a6c61015c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -8,6 +8,7 @@ package org.elasticsearch.xpack.sql.qa.jdbc;
import org.apache.logging.log4j.Logger;
import org.elasticsearch.xpack.sql.action.CliFormatter;
import org.elasticsearch.xpack.sql.proto.ColumnInfo;
import org.elasticsearch.xpack.sql.proto.StringUtils;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
@ -134,7 +135,7 @@ public abstract class JdbcTestUtils {
logger.info("\n" + formatter.formatWithHeader(cols, data));
}
public static ZonedDateTime of(long millis) {
return ZonedDateTime.ofInstant(Instant.ofEpochMilli(millis), UTC);
public static String of(long millis) {
return StringUtils.toString(ZonedDateTime.ofInstant(Instant.ofEpochMilli(millis), UTC));
}
}