Repository: googleapis/java-spanner-jdbc
Pull request #173 (2020-06-28 16:45:30)

ci(java): run dependency test on Java 8 and 11
This PR was generated using Autosynth. :rainbow:

Synth log will be available here:
https://source.cloud.google.com/results/invocations/351f1c1a-f71f-4cfc-968c-ac334fd05a73/targets

- [ ] To automatically regenerate this PR, check this box.

Source-Link: https://github.com/googleapis/synthtool/commit/4f2c9f752a94042472fc03c5bd9e06e89817d2bd

codecov[bot]: # [Codecov](https://codecov.io/gh/googleapis/java-spanner-jdbc/pull/173?src=pr&el=h1) Report
> Merging [#173](https://codecov.io/gh/googleapis/java-spanner-jdbc/pull/173?src=pr&el=desc) into [master](https://codecov.io/gh/googleapis/java-spanner-jdbc/commit/7c336d0ae1328440d38713f66ea9459ffbdc3101&el=desc) will **not change** coverage.
> The diff coverage is `n/a`.

[![Impacted file tree graph](https://codecov.io/gh/googleapis/java-spanner-jdbc/pull/173/graphs/tree.svg?width=650&height=150&src=pr&token=ODlczvbGrj)](https://codecov.io/gh/googleapis/java-spanner-jdbc/pull/173?src=pr&el=tree)

```diff
@@            Coverage Diff            @@
##             master     #173   +/-   ##
=========================================
  Coverage     72.20%   72.20%           
  Complexity     1095     1095           
=========================================
  Files            24       24           
  Lines          3292     3292           
  Branches        495      495           
=========================================
  Hits           2377     2377           
  Misses          722      722           
  Partials        193      193           
```



------

[Continue to review full report at Codecov](https://codecov.io/gh/googleapis/java-spanner-jdbc/pull/173?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/googleapis/java-spanner-jdbc/pull/173?src=pr&el=footer). Last update [7c336d0...1a931a0](https://codecov.io/gh/googleapis/java-spanner-jdbc/pull/173?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).


Patch:
diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml
index 445b4bf..6830220 100644
--- a/.github/workflows/ci.yaml
+++ b/.github/workflows/ci.yaml
@@ -36,11 +36,14 @@ jobs:
         JOB_TYPE: test
   dependencies:
     runs-on: ubuntu-latest
+    strategy:
+      matrix:
+        java: [8, 11]
     steps:
     - uses: actions/checkout@v2
     - uses: actions/setup-java@v1
       with:
-        java-version: 8
+        java-version: ${{matrix.java}}
     - run: java -version
     - run: .kokoro/dependencies.sh
   linkage-monitor:
diff --git a/.kokoro/dependencies.sh b/.kokoro/dependencies.sh
index cf3bb43..cee4f11 100755
--- a/.kokoro/dependencies.sh
+++ b/.kokoro/dependencies.sh
@@ -41,8 +41,10 @@ echo "****************** DEPENDENCY LIST COMPLETENESS CHECK *******************"
 ## Run dependency list completeness check
 function completenessCheck() {
   # Output dep list with compile scope generated using the original pom
+  # Running mvn dependency:list on Java versions that support modules will also include the module of the dependency.
+  # This is stripped from the output as it is not present in the flattened pom.
   msg "Generating dependency list using original pom..."
-  mvn dependency:list -f pom.xml -Dsort=true | grep '\[INFO]    .*:.*:.*:.*:.*' | grep -v ':test$' >.org-list.txt
+  mvn dependency:list -f pom.xml -Dsort=true | grep '\[INFO]    .*:.*:.*:.*:.*' | sed -e s/\\s--\\smodule.*// | grep -v ':test$' >.org-list.txt
 
   # Output dep list generated using the flattened pom (test scope deps are ommitted)
   msg "Generating dependency list using flattened pom..."
diff --git a/pom.xml b/pom.xml
index de92a18..fe33341 100644
--- a/pom.xml
+++ b/pom.xml
@@ -78,7 +78,7 @@
       <dependency>
         <groupId>com.google.cloud</groupId>
         <artifactId>google-cloud-shared-dependencies</artifactId>
-        <version>0.8.1</version>
+        <version>0.8.2</version>
         <type>pom</type>
         <scope>import</scope>
       </dependency>
diff --git a/src/main/java/com/google/cloud/spanner/jdbc/JdbcConnection.java b/src/main/java/com/google/cloud/spanner/jdbc/JdbcConnection.java
index 5aefd35..4e23180 100644
--- a/src/main/java/com/google/cloud/spanner/jdbc/JdbcConnection.java
+++ b/src/main/java/com/google/cloud/spanner/jdbc/JdbcConnection.java
@@ -291,7 +291,7 @@ class JdbcConnection extends AbstractJdbcConnection {
   @Override
   public String getCatalog() throws SQLException {
     checkClosed();
-    return getConnectionOptions().getDatabaseName();
+    return "";
   }
 
   @Override
diff --git a/synth.metadata b/synth.metadata
index bd8a5c3..980c749 100644
--- a/synth.metadata
+++ b/synth.metadata
@@ -4,14 +4,14 @@
       "git": {
         "name": ".",
         "remote": "https://github.com/googleapis/java-spanner-jdbc.git",
-        "sha": "36612ee15b3a2c72018aed16848c399f4bcfc2a3"
+        "sha": "7c336d0ae1328440d38713f66ea9459ffbdc3101"
       }
     },
     {
       "git": {
         "name": "synthtool",
         "remote": "https://github.com/googleapis/synthtool.git",
-        "sha": "c4f3059c27591eb24d6942a0e357ec94c80459f2"
+        "sha": "4f2c9f752a94042472fc03c5bd9e06e89817d2bd"
       }
     }
   ]


Test patch:
diff --git a/src/test/java/com/google/cloud/spanner/jdbc/JdbcConnectionTest.java b/src/test/java/com/google/cloud/spanner/jdbc/JdbcConnectionTest.java
index a80e800..82e26d0 100644
--- a/src/test/java/com/google/cloud/spanner/jdbc/JdbcConnectionTest.java
+++ b/src/test/java/com/google/cloud/spanner/jdbc/JdbcConnectionTest.java
@@ -634,7 +634,9 @@ public class JdbcConnectionTest {
     ConnectionOptions options = mock(ConnectionOptions.class);
     when(options.getDatabaseName()).thenReturn("test");
     try (JdbcConnection connection = createConnection(options)) {
-      assertThat(connection.getCatalog()).isEqualTo("test");
+      // The connection should always return the empty string as the current catalog, as no other
+      // catalogs exist in the INFORMATION_SCHEMA.
+      assertThat(connection.getCatalog()).isEqualTo("");
       // This should be allowed.
       connection.setCatalog("");
       try {