Skip to content

Commit

Permalink
Fix linter complaints
Browse files Browse the repository at this point in the history
  • Loading branch information
wnob committed Dec 21, 2023
1 parent d6aab6e commit 1401776
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@
<version>1.7</version>
<style>GOOGLE</style>
</googleJavaFormat>
<toggleOffOn />
</java>
</configuration>
</plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -800,8 +800,9 @@ public void testHandlesAllNullResponseFields() throws Exception {
@Test
public void testHandlesNullTimeDateObjects() throws Exception {
this.NewConnection("&useLegacySql=false");
Statement stmt = BQForwardOnlyResultSetFunctionTest.con.createStatement(
ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
Statement stmt =
BQForwardOnlyResultSetFunctionTest.con.createStatement(
ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);

final String date = "2011-11-11";
final String time = "12:12:12";
Expand All @@ -810,6 +811,7 @@ public void testHandlesNullTimeDateObjects() throws Exception {
// The number of milliseconds between epoch and 2011-11-11 12:12:12 UTC+0.
final long millis = 1321013532000L;

// spotless:off
String sql = "SELECT " +
"TIMESTAMP('" + dateTime + "') AS ts, " +
"DATETIME('" + dateTime + "') AS dt, " +
Expand All @@ -820,12 +822,14 @@ public void testHandlesNullTimeDateObjects() throws Exception {
"CASE WHEN 1 = 0 THEN DATETIME('" + dateTime + "') ELSE NULL END, " +
"CASE WHEN 1 = 0 THEN DATE('" + date + "') ELSE NULL END, " +
"CASE WHEN 1 = 0 THEN TIME(12, 12, 12) ELSE NULL END";
// spotless:on

ResultSet results = stmt.executeQuery(sql);

// First row has all non-null objects.
Assertions.assertThat(results.next()).isTrue();
Assertions.assertThat(results.getObject("ts")).isEqualTo(Timestamp.from(Instant.ofEpochMilli(millis)));
Assertions.assertThat(results.getObject("ts"))
.isEqualTo(Timestamp.from(Instant.ofEpochMilli(millis)));
Assertions.assertThat(results.getString("ts")).isEqualTo(dateTime + " UTC");
Assertions.assertThat(results.getObject("dt")).isEqualTo(Timestamp.valueOf(dateTime));
Assertions.assertThat(results.getString("dt")).isEqualTo(dateTimeWithT);
Expand Down

0 comments on commit 1401776

Please sign in to comment.