Skip to content

Commit 2cb6c99

Browse files
deps: update dependency com.google.cloud:google-cloud-spanner-bom to v6.79.0 (#1786)
* deps: update dependency com.google.cloud:google-cloud-spanner-bom to v6.79.0 * chore: rename methods to avoid name clash --------- Co-authored-by: Knut Olav Løite <[email protected]>
1 parent 3b117c0 commit 2cb6c99

11 files changed

+96
-87
lines changed

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<parent>
1515
<groupId>com.google.cloud</groupId>
1616
<artifactId>sdk-platform-java-config</artifactId>
17-
<version>3.36.1</version>
17+
<version>3.37.0</version>
1818
</parent>
1919
<developers>
2020
<developer>
@@ -61,7 +61,7 @@
6161
<dependency>
6262
<groupId>com.google.cloud</groupId>
6363
<artifactId>google-cloud-spanner-bom</artifactId>
64-
<version>6.78.0</version>
64+
<version>6.79.0</version>
6565
<type>pom</type>
6666
<scope>import</scope>
6767
</dependency>

samples/spring-data-jdbc/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
<dependency>
3131
<groupId>com.google.cloud</groupId>
3232
<artifactId>google-cloud-spanner-bom</artifactId>
33-
<version>6.78.0</version>
33+
<version>6.79.0</version>
3434
<scope>import</scope>
3535
<type>pom</type>
3636
</dependency>

src/test/java/com/google/cloud/spanner/jdbc/ClientSideStatementHintsTest.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,14 @@ private String createUrl() {
6868
getPort(), "proj", "inst", "db" + (dialect == Dialect.POSTGRESQL ? "pg" : ""));
6969
}
7070

71-
private Connection createConnection() throws SQLException {
71+
@Override
72+
protected Connection createJdbcConnection() throws SQLException {
7273
return DriverManager.getConnection(createUrl());
7374
}
7475

7576
@Test
7677
public void testStatementTagInHint() throws SQLException {
77-
try (Connection connection = createConnection()) {
78+
try (Connection connection = createJdbcConnection()) {
7879
try (ResultSet resultSet =
7980
connection
8081
.createStatement()
@@ -94,7 +95,7 @@ public void testStatementTagInHint() throws SQLException {
9495

9596
@Test
9697
public void testRpcPriorityInHint() throws SQLException {
97-
try (Connection connection = createConnection()) {
98+
try (Connection connection = createJdbcConnection()) {
9899
try (ResultSet resultSet =
99100
connection
100101
.createStatement()

src/test/java/com/google/cloud/spanner/jdbc/ExecuteMockServerTest.java

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -205,13 +205,14 @@ private String createUrl() {
205205
getPort(), "proj", "inst", "db");
206206
}
207207

208-
private Connection createConnection() throws SQLException {
208+
@Override
209+
protected Connection createJdbcConnection() throws SQLException {
209210
return DriverManager.getConnection(createUrl());
210211
}
211212

212213
@Test
213214
public void testStatementExecuteQuery() throws SQLException {
214-
try (Connection connection = createConnection();
215+
try (Connection connection = createJdbcConnection();
215216
Statement statement = connection.createStatement()) {
216217
try (ResultSet resultSet = statement.executeQuery(query)) {
217218
verifyResultSet(resultSet);
@@ -231,7 +232,7 @@ public void testStatementExecuteQuery() throws SQLException {
231232

232233
@Test
233234
public void testStatementExecuteUpdate() throws SQLException {
234-
try (Connection connection = createConnection();
235+
try (Connection connection = createJdbcConnection();
235236
Statement statement = connection.createStatement()) {
236237
assertEquals(1, statement.executeUpdate(dml));
237238
assertEquals(0, statement.executeUpdate(DDL));
@@ -249,7 +250,7 @@ public void testStatementExecuteUpdate() throws SQLException {
249250

250251
@Test
251252
public void testStatementExecuteUpdateReturnGeneratedKeys() throws SQLException {
252-
try (Connection connection = createConnection();
253+
try (Connection connection = createJdbcConnection();
253254
Statement statement = connection.createStatement()) {
254255
// TODO: Add tests for RETURN_GENERATED_KEYS when that is supported.
255256
assertEquals(1, statement.executeUpdate(dml, Statement.NO_GENERATED_KEYS));
@@ -265,7 +266,7 @@ public void testStatementExecuteUpdateReturnGeneratedKeys() throws SQLException
265266

266267
@Test
267268
public void testStatementExecuteUpdateReturnColumnNames() throws SQLException {
268-
try (Connection connection = createConnection();
269+
try (Connection connection = createJdbcConnection();
269270
Statement statement = connection.createStatement()) {
270271
assertEquals(1, statement.executeUpdate(dml, new String[] {"id"}));
271272
assertEquals(0, statement.executeUpdate(DDL, new String[] {"id"}));
@@ -283,7 +284,7 @@ public void testStatementExecuteUpdateReturnColumnNames() throws SQLException {
283284

284285
@Test
285286
public void testStatementExecuteUpdateReturnColumnIndexes() throws SQLException {
286-
try (Connection connection = createConnection();
287+
try (Connection connection = createJdbcConnection();
287288
Statement statement = connection.createStatement()) {
288289
assertEquals(1, statement.executeUpdate(dml, new int[] {1}));
289290
assertEquals(0, statement.executeUpdate(DDL, new int[] {1}));
@@ -297,7 +298,7 @@ public void testStatementExecuteUpdateReturnColumnIndexes() throws SQLException
297298

298299
@Test
299300
public void testStatementLargeExecuteUpdate() throws SQLException {
300-
try (Connection connection = createConnection();
301+
try (Connection connection = createJdbcConnection();
301302
Statement statement = connection.createStatement()) {
302303
assertEquals(1L, statement.executeLargeUpdate(dml));
303304
assertEquals(0L, statement.executeLargeUpdate(DDL));
@@ -311,7 +312,7 @@ public void testStatementLargeExecuteUpdate() throws SQLException {
311312

312313
@Test
313314
public void testStatementExecuteLargeUpdateReturnGeneratedKeys() throws SQLException {
314-
try (Connection connection = createConnection();
315+
try (Connection connection = createJdbcConnection();
315316
Statement statement = connection.createStatement()) {
316317
// TODO: Add tests for RETURN_GENERATED_KEYS when that is supported.
317318
assertEquals(1, statement.executeLargeUpdate(dml, Statement.NO_GENERATED_KEYS));
@@ -329,7 +330,7 @@ public void testStatementExecuteLargeUpdateReturnGeneratedKeys() throws SQLExcep
329330

330331
@Test
331332
public void testStatementExecuteLargeUpdateReturnColumnNames() throws SQLException {
332-
try (Connection connection = createConnection();
333+
try (Connection connection = createJdbcConnection();
333334
Statement statement = connection.createStatement()) {
334335
assertEquals(1, statement.executeLargeUpdate(dml, new String[] {"id"}));
335336
assertEquals(0, statement.executeLargeUpdate(DDL, new String[] {"id"}));
@@ -346,7 +347,7 @@ public void testStatementExecuteLargeUpdateReturnColumnNames() throws SQLExcepti
346347

347348
@Test
348349
public void testStatementExecuteLargeUpdateReturnColumnIndexes() throws SQLException {
349-
try (Connection connection = createConnection();
350+
try (Connection connection = createJdbcConnection();
350351
Statement statement = connection.createStatement()) {
351352
assertEquals(1, statement.executeLargeUpdate(dml, new int[] {1}));
352353
assertEquals(0, statement.executeLargeUpdate(DDL, new int[] {1}));
@@ -360,7 +361,7 @@ public void testStatementExecuteLargeUpdateReturnColumnIndexes() throws SQLExcep
360361

361362
@Test
362363
public void testStatementExecute() throws SQLException {
363-
try (Connection connection = createConnection();
364+
try (Connection connection = createJdbcConnection();
364365
Statement statement = connection.createStatement()) {
365366
verifyUpdateCount(statement, () -> statement.execute(dml), 1L);
366367
verifyUpdateCount(statement, () -> statement.execute(largeDml), LARGE_UPDATE_COUNT);
@@ -375,7 +376,7 @@ public void testStatementExecute() throws SQLException {
375376

376377
@Test
377378
public void testStatementExecuteReturnGeneratedKeys() throws SQLException {
378-
try (Connection connection = createConnection();
379+
try (Connection connection = createJdbcConnection();
379380
Statement statement = connection.createStatement()) {
380381
// TODO: Add tests for RETURN_GENERATED_KEYS when that is supported.
381382
verifyUpdateCount(statement, () -> statement.execute(dml, Statement.NO_GENERATED_KEYS), 1L);
@@ -401,7 +402,7 @@ public void testStatementExecuteReturnGeneratedKeys() throws SQLException {
401402

402403
@Test
403404
public void testStatementExecuteReturnColumnNames() throws SQLException {
404-
try (Connection connection = createConnection();
405+
try (Connection connection = createJdbcConnection();
405406
Statement statement = connection.createStatement()) {
406407
verifyUpdateCount(statement, () -> statement.execute(dml, new String[] {"id"}), 1L);
407408
verifyUpdateCount(
@@ -420,7 +421,7 @@ public void testStatementExecuteReturnColumnNames() throws SQLException {
420421

421422
@Test
422423
public void testStatementExecuteReturnColumnIndexes() throws SQLException {
423-
try (Connection connection = createConnection();
424+
try (Connection connection = createJdbcConnection();
424425
Statement statement = connection.createStatement()) {
425426
verifyUpdateCount(statement, () -> statement.execute(dml, new int[] {1}), 1L);
426427
verifyUpdateCount(
@@ -439,7 +440,7 @@ public void testStatementExecuteReturnColumnIndexes() throws SQLException {
439440

440441
@Test
441442
public void testPreparedStatementExecuteQuery() throws SQLException {
442-
try (Connection connection = createConnection()) {
443+
try (Connection connection = createJdbcConnection()) {
443444
try (ResultSet resultSet = connection.prepareStatement(query).executeQuery()) {
444445
verifyResultSet(resultSet);
445446
}
@@ -458,7 +459,7 @@ public void testPreparedStatementExecuteQuery() throws SQLException {
458459

459460
@Test
460461
public void testPreparedStatementExecuteUpdate() throws SQLException {
461-
try (Connection connection = createConnection()) {
462+
try (Connection connection = createJdbcConnection()) {
462463
assertEquals(1, connection.prepareStatement(dml).executeUpdate());
463464
assertEquals(0, connection.prepareStatement(DDL).executeUpdate());
464465
assertEquals(0, connection.prepareStatement(clientSideUpdate).executeUpdate());
@@ -472,7 +473,7 @@ public void testPreparedStatementExecuteUpdate() throws SQLException {
472473

473474
@Test
474475
public void testPreparedStatementExecuteUpdateReturnGeneratedKeys() throws SQLException {
475-
try (Connection connection = createConnection()) {
476+
try (Connection connection = createJdbcConnection()) {
476477
// TODO: Add tests for RETURN_GENERATED_KEYS when that is supported.
477478
assertEquals(
478479
1, connection.prepareStatement(dml, Statement.NO_GENERATED_KEYS).executeUpdate());
@@ -503,7 +504,7 @@ public void testPreparedStatementExecuteUpdateReturnGeneratedKeys() throws SQLEx
503504

504505
@Test
505506
public void testPreparedStatementExecuteUpdateReturnColumnNames() throws SQLException {
506-
try (Connection connection = createConnection()) {
507+
try (Connection connection = createJdbcConnection()) {
507508
assertEquals(1, connection.prepareStatement(dml, new String[] {"id"}).executeUpdate());
508509
assertEquals(0, connection.prepareStatement(DDL, new String[] {"id"}).executeUpdate());
509510
assertEquals(
@@ -523,7 +524,7 @@ public void testPreparedStatementExecuteUpdateReturnColumnNames() throws SQLExce
523524

524525
@Test
525526
public void testPreparedStatementExecuteUpdateReturnColumnIndexes() throws SQLException {
526-
try (Connection connection = createConnection()) {
527+
try (Connection connection = createJdbcConnection()) {
527528
assertEquals(1, connection.prepareStatement(dml, new int[] {1}).executeUpdate());
528529
assertEquals(0, connection.prepareStatement(DDL, new int[] {1}).executeUpdate());
529530
assertEquals(0, connection.prepareStatement(clientSideUpdate, new int[] {1}).executeUpdate());
@@ -539,7 +540,7 @@ public void testPreparedStatementExecuteUpdateReturnColumnIndexes() throws SQLEx
539540

540541
@Test
541542
public void testPreparedStatementLargeExecuteUpdate() throws SQLException {
542-
try (Connection connection = createConnection()) {
543+
try (Connection connection = createJdbcConnection()) {
543544
assertEquals(1L, connection.prepareStatement(dml).executeLargeUpdate());
544545
assertEquals(0L, connection.prepareStatement(DDL).executeLargeUpdate());
545546
assertEquals(0L, connection.prepareStatement(clientSideUpdate).executeLargeUpdate());
@@ -554,7 +555,7 @@ public void testPreparedStatementLargeExecuteUpdate() throws SQLException {
554555

555556
@Test
556557
public void testPreparedStatementExecuteLargeUpdateReturnGeneratedKeys() throws SQLException {
557-
try (Connection connection = createConnection()) {
558+
try (Connection connection = createJdbcConnection()) {
558559
// TODO: Add tests for RETURN_GENERATED_KEYS when that is supported.
559560
assertEquals(
560561
1, connection.prepareStatement(dml, Statement.NO_GENERATED_KEYS).executeLargeUpdate());
@@ -587,7 +588,7 @@ public void testPreparedStatementExecuteLargeUpdateReturnGeneratedKeys() throws
587588

588589
@Test
589590
public void testPreparedStatementExecuteLargeUpdateReturnColumnNames() throws SQLException {
590-
try (Connection connection = createConnection()) {
591+
try (Connection connection = createJdbcConnection()) {
591592
assertEquals(1, connection.prepareStatement(dml, new String[] {"id"}).executeLargeUpdate());
592593
assertEquals(0, connection.prepareStatement(DDL, new String[] {"id"}).executeLargeUpdate());
593594
assertEquals(
@@ -612,7 +613,7 @@ public void testPreparedStatementExecuteLargeUpdateReturnColumnNames() throws SQ
612613

613614
@Test
614615
public void testPreparedStatementExecuteLargeUpdateReturnColumnIndexes() throws SQLException {
615-
try (Connection connection = createConnection()) {
616+
try (Connection connection = createJdbcConnection()) {
616617
assertEquals(1, connection.prepareStatement(dml, new int[] {1}).executeLargeUpdate());
617618
assertEquals(0, connection.prepareStatement(DDL, new int[] {1}).executeLargeUpdate());
618619
assertEquals(
@@ -631,7 +632,7 @@ public void testPreparedStatementExecuteLargeUpdateReturnColumnIndexes() throws
631632

632633
@Test
633634
public void testPreparedStatementExecute() throws SQLException {
634-
try (Connection connection = createConnection()) {
635+
try (Connection connection = createJdbcConnection()) {
635636
verifyPreparedUpdateCount(connection.prepareStatement(dml), PreparedStatement::execute, 1L);
636637
verifyPreparedUpdateCount(
637638
connection.prepareStatement(largeDml), PreparedStatement::execute, LARGE_UPDATE_COUNT);
@@ -651,7 +652,7 @@ public void testPreparedStatementExecute() throws SQLException {
651652

652653
@Test
653654
public void testPreparedStatementExecuteReturnGeneratedKeys() throws SQLException {
654-
try (Connection connection = createConnection()) {
655+
try (Connection connection = createJdbcConnection()) {
655656
// TODO: Add tests for RETURN_GENERATED_KEYS when that is supported.
656657
verifyPreparedUpdateCount(
657658
connection.prepareStatement(dml, Statement.NO_GENERATED_KEYS),
@@ -683,7 +684,7 @@ public void testPreparedStatementExecuteReturnGeneratedKeys() throws SQLExceptio
683684

684685
@Test
685686
public void testPreparedStatementExecuteReturnColumnNames() throws SQLException {
686-
try (Connection connection = createConnection()) {
687+
try (Connection connection = createJdbcConnection()) {
687688
verifyPreparedUpdateCount(
688689
connection.prepareStatement(dml, new String[] {"id"}), PreparedStatement::execute, 1L);
689690
verifyPreparedUpdateCount(
@@ -711,7 +712,7 @@ public void testPreparedStatementExecuteReturnColumnNames() throws SQLException
711712

712713
@Test
713714
public void testPreparedStatementExecuteReturnColumnIndexes() throws SQLException {
714-
try (Connection connection = createConnection()) {
715+
try (Connection connection = createJdbcConnection()) {
715716
verifyPreparedUpdateCount(
716717
connection.prepareStatement(dml, new int[] {1}), PreparedStatement::execute, 1L);
717718
verifyPreparedUpdateCount(

src/test/java/com/google/cloud/spanner/jdbc/MultiplexedSessionsMockServerTest.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,14 @@ private String createUrl() {
7777
getPort(), "proj", "inst", "db" + (dialect == Dialect.POSTGRESQL ? "pg" : ""));
7878
}
7979

80-
private Connection createConnection() throws SQLException {
80+
@Override
81+
protected Connection createJdbcConnection() throws SQLException {
8182
return DriverManager.getConnection(createUrl());
8283
}
8384

8485
@Test
8586
public void testUsesMultiplexedSessionForQueryInAutoCommit() throws SQLException {
86-
try (Connection connection = createConnection()) {
87+
try (Connection connection = createJdbcConnection()) {
8788
assertTrue(connection.getAutoCommit());
8889
try (ResultSet resultSet = connection.createStatement().executeQuery(SELECT_RANDOM_SQL)) {
8990
//noinspection StatementWithEmptyBody
@@ -106,7 +107,7 @@ public void testUsesMultiplexedSessionForQueryInAutoCommit() throws SQLException
106107
@Test
107108
public void testUsesMultiplexedSessionForQueryInReadOnlyTransaction() throws SQLException {
108109
int numQueries = 2;
109-
try (Connection connection = createConnection()) {
110+
try (Connection connection = createJdbcConnection()) {
110111
connection.setReadOnly(true);
111112
connection.setAutoCommit(false);
112113

@@ -137,7 +138,7 @@ public void testUsesMultiplexedSessionForQueryInReadOnlyTransaction() throws SQL
137138

138139
@Test
139140
public void testUsesRegularSessionForDmlInAutoCommit() throws SQLException {
140-
try (Connection connection = createConnection()) {
141+
try (Connection connection = createJdbcConnection()) {
141142
assertTrue(connection.getAutoCommit());
142143
assertEquals(1, connection.createStatement().executeUpdate(INSERT_SQL));
143144
}
@@ -158,7 +159,7 @@ public void testUsesRegularSessionForDmlInAutoCommit() throws SQLException {
158159

159160
@Test
160161
public void testUsesRegularSessionForQueryInTransaction() throws SQLException {
161-
try (Connection connection = createConnection()) {
162+
try (Connection connection = createJdbcConnection()) {
162163
connection.setAutoCommit(false);
163164
assertFalse(connection.getAutoCommit());
164165

0 commit comments

Comments
 (0)