diff --git a/bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/config/BigtableOptions.java b/bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/config/BigtableOptions.java index 130388e7ed..f14b144d10 100644 --- a/bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/config/BigtableOptions.java +++ b/bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/config/BigtableOptions.java @@ -203,6 +203,7 @@ private void applyEmulatorEnvironment() { " environment variable: " + emulatorHost); } setUsePlaintextNegotiation(true); + setCredentialOptions(CredentialOptions.nullCredential()); setDataHost(hostPort[0]); setTableAdminHost(hostPort[0]); setInstanceAdminHost(hostPort[0]); diff --git a/bigtable-client-core-parent/bigtable-client-core/src/test/java/com/google/cloud/bigtable/config/TestBigtableOptions.java b/bigtable-client-core-parent/bigtable-client-core/src/test/java/com/google/cloud/bigtable/config/TestBigtableOptions.java index db3723f742..c74f05c632 100644 --- a/bigtable-client-core-parent/bigtable-client-core/src/test/java/com/google/cloud/bigtable/config/TestBigtableOptions.java +++ b/bigtable-client-core-parent/bigtable-client-core/src/test/java/com/google/cloud/bigtable/config/TestBigtableOptions.java @@ -102,6 +102,7 @@ public void testEmulator() { Assert.assertEquals("localhost", options.getInstanceAdminHost()); Assert.assertEquals("localhost", options.getTableAdminHost()); Assert.assertTrue(options.usePlaintextNegotiation()); + Assert.assertEquals(CredentialOptions.nullCredential(), options.getCredentialOptions()); setTestEnv(oldEnv); options = new BigtableOptions.Builder() @@ -112,6 +113,7 @@ public void testEmulator() { Assert.assertEquals(BigtableOptions.BIGTABLE_INSTANCE_ADMIN_HOST_DEFAULT, options.getInstanceAdminHost()); Assert.assertEquals(BigtableOptions.BIGTABLE_TABLE_ADMIN_HOST_DEFAULT, options.getTableAdminHost()); Assert.assertFalse(options.usePlaintextNegotiation()); + Assert.assertEquals(CredentialOptions.defaultCredentials(), options.getCredentialOptions()); } /**