Repository: googleapis/java-bigtable-hbase
Pull request #2308 (2019-12-16 16:30:41)

deps: fix hbaseLocalMiniClusterTestH2 tests
When fixing the 'used but undeclared' dependency issues, the version of hadoop-common was set to 2.7.4 (when it was 2.8.5). This caused the hbaseLocalMiniClusterTestH2 tests to fail because they could not initialize. 


Patch:
diff --git a/bigtable-hbase-1.x-parent/bigtable-hbase-1.x-hadoop/pom.xml b/bigtable-hbase-1.x-parent/bigtable-hbase-1.x-hadoop/pom.xml
index c1f2422e4..3a5a1d4de 100644
--- a/bigtable-hbase-1.x-parent/bigtable-hbase-1.x-hadoop/pom.xml
+++ b/bigtable-hbase-1.x-parent/bigtable-hbase-1.x-hadoop/pom.xml
@@ -76,7 +76,7 @@ limitations under the License.
     <dependency>
       <groupId>org.apache.hadoop</groupId>
       <artifactId>hadoop-common</artifactId>
-      <version>${hadoop.version}</version>
+      <version>${hbase1-hadoop.version}</version>
     </dependency>
     <dependency>
       <groupId>org.apache.hbase</groupId>
diff --git a/bigtable-hbase-2.x-parent/bigtable-hbase-2.x-hadoop/pom.xml b/bigtable-hbase-2.x-parent/bigtable-hbase-2.x-hadoop/pom.xml
index 4894257f8..74d878556 100644
--- a/bigtable-hbase-2.x-parent/bigtable-hbase-2.x-hadoop/pom.xml
+++ b/bigtable-hbase-2.x-parent/bigtable-hbase-2.x-hadoop/pom.xml
@@ -80,7 +80,7 @@ limitations under the License.
     <dependency>
       <groupId>org.apache.hadoop</groupId>
       <artifactId>hadoop-common</artifactId>
-      <version>${hadoop.version}</version>
+      <version>${hbase2-hadoop.version}</version>
     </dependency>
     <dependency>
       <groupId>org.apache.hbase</groupId>
diff --git a/pom.xml b/pom.xml
index 6ea16a518..c00c35099 100644
--- a/pom.xml
+++ b/pom.xml
@@ -73,7 +73,8 @@ limitations under the License.
         <hbase.version.1>1.4.10</hbase.version.1>
         <hbase.version.2>2.2.0</hbase.version.2>
         <hbase.version>${hbase.version.1}</hbase.version>
-        <hadoop.version>2.7.4</hadoop.version>
+        <hbase1-hadoop.version>2.7.4</hbase1-hadoop.version>
+        <hbase2-hadoop.version>2.8.5</hbase2-hadoop.version>
         <hbase-guava.version>12.0.1</hbase-guava.version>
         <hbase-protobuf.version>2.5.0</hbase-protobuf.version>
 


Test patch:
diff --git a/bigtable-client-core-parent/bigtable-hbase-integration-tests-common/pom.xml b/bigtable-client-core-parent/bigtable-hbase-integration-tests-common/pom.xml
index 3323b4077..76185d728 100644
--- a/bigtable-client-core-parent/bigtable-hbase-integration-tests-common/pom.xml
+++ b/bigtable-client-core-parent/bigtable-hbase-integration-tests-common/pom.xml
@@ -57,7 +57,7 @@ limitations under the License.
         <dependency>
             <groupId>org.apache.hadoop</groupId>
             <artifactId>hadoop-common</artifactId>
-            <version>${hadoop.version}</version>
+            <version>${hbase1-hadoop.version}</version>
             <scope>test</scope>
         </dependency>
         <dependency>
diff --git a/bigtable-hbase-1.x-parent/bigtable-hbase-1.x-integration-tests/pom.xml b/bigtable-hbase-1.x-parent/bigtable-hbase-1.x-integration-tests/pom.xml
index ff55de6e4..a5cbeac83 100644
--- a/bigtable-hbase-1.x-parent/bigtable-hbase-1.x-integration-tests/pom.xml
+++ b/bigtable-hbase-1.x-parent/bigtable-hbase-1.x-integration-tests/pom.xml
@@ -323,7 +323,7 @@ limitations under the License.
         <dependency>
             <groupId>org.apache.hadoop</groupId>
             <artifactId>hadoop-common</artifactId>
-            <version>${hadoop.version}</version>
+            <version>${hbase1-hadoop.version}</version>
             <scope>test</scope>
         </dependency>
         <dependency>
diff --git a/bigtable-hbase-2.x-parent/bigtable-hbase-2.x-integration-tests/pom.xml b/bigtable-hbase-2.x-parent/bigtable-hbase-2.x-integration-tests/pom.xml
index 893ab49ab..db46c1e3b 100644
--- a/bigtable-hbase-2.x-parent/bigtable-hbase-2.x-integration-tests/pom.xml
+++ b/bigtable-hbase-2.x-parent/bigtable-hbase-2.x-integration-tests/pom.xml
@@ -336,6 +336,12 @@ limitations under the License.
             <version>${commons-lang.version}</version>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>org.apache.hadoop</groupId>
+            <artifactId>hadoop-common</artifactId>
+            <version>${hbase2-hadoop.version}</version>
+            <scope>test</scope>
+        </dependency>
         <dependency>
             <groupId>org.apache.hbase</groupId>
             <artifactId>hbase-common</artifactId>
diff --git a/bigtable-hbase-2.x-parent/bigtable-hbase-2.x-integration-tests/src/test/java/com/google/cloud/bigtable/hbase/async/AbstractAsyncTest.java b/bigtable-hbase-2.x-parent/bigtable-hbase-2.x-integration-tests/src/test/java/com/google/cloud/bigtable/hbase/async/AbstractAsyncTest.java
index 860bb4361..2252ec79b 100644
--- a/bigtable-hbase-2.x-parent/bigtable-hbase-2.x-integration-tests/src/test/java/com/google/cloud/bigtable/hbase/async/AbstractAsyncTest.java
+++ b/bigtable-hbase-2.x-parent/bigtable-hbase-2.x-integration-tests/src/test/java/com/google/cloud/bigtable/hbase/async/AbstractAsyncTest.java
@@ -18,6 +18,7 @@ package com.google.cloud.bigtable.hbase.async;
 import com.google.cloud.bigtable.hbase.AbstractTest;
 import com.google.cloud.bigtable.hbase.test_env.SharedTestEnvRule;
 import java.util.concurrent.ExecutionException;
+import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hbase.client.AsyncConnection;
 import org.apache.hadoop.hbase.client.AsyncTable;
 import org.apache.hadoop.hbase.client.ConnectionFactory;
@@ -32,7 +33,8 @@ public abstract class AbstractAsyncTest extends AbstractTest {
     SharedTestEnvRule sharedEnv = SharedTestEnvRule.getInstance();
     AsyncConnection conn = (AsyncConnection) sharedEnv.getClosable(CONN_KEY);
     if (conn == null) {
-      conn = ConnectionFactory.createAsyncConnection(sharedEnv.getConfiguration()).get();
+      Configuration sharedEnvConfiguration = sharedEnv.getConfiguration();
+      conn = ConnectionFactory.createAsyncConnection(sharedEnvConfiguration).get();
       sharedEnv.registerClosable(CONN_KEY, conn);
     }
     return conn;