From 4c562c549a2368211119ffd0422cd958f13ec349 Mon Sep 17 00:00:00 2001 From: Rajat Bhatta <93644539+rajatbhatta@users.noreply.github.com> Date: Thu, 26 May 2022 21:45:19 +0530 Subject: [PATCH] test: fix assert for testConnectWithCredentialsAndOAuthToken testConnectWithCredentialsAndOAuthToken test was failing with following error - JdbcDriverTest.testConnectWithCredentialsAndOAuthToken:135 expected to contain: Cannot specify both credentials and an OAuth token but was : INVALID_ARGUMENT: Specify only one of credentialsUrl, encodedCredentials, credentialsProvider and OAuth token. Changing assertThat to account for this change. The exception message was changed as part of googleapis/java-spanner#1869. --- .../java/com/google/cloud/spanner/jdbc/JdbcDriverTest.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/test/java/com/google/cloud/spanner/jdbc/JdbcDriverTest.java b/src/test/java/com/google/cloud/spanner/jdbc/JdbcDriverTest.java index dd988ca71..22ec7be7b 100644 --- a/src/test/java/com/google/cloud/spanner/jdbc/JdbcDriverTest.java +++ b/src/test/java/com/google/cloud/spanner/jdbc/JdbcDriverTest.java @@ -132,8 +132,9 @@ public void testConnectWithCredentialsAndOAuthToken() { server.getPort(), TEST_KEY_PATH, "some-token"))) { fail("missing expected exception"); } catch (SQLException e) { - assertThat(e.getMessage()).contains("Cannot specify both credentials and an OAuth token"); - } + assertThat(e.getMessage()) + .contains( + "Specify only one of credentialsUrl, encodedCredentials, credentialsProvider and OAuth token"); } @Test