Skip to content

Commit 84848a1

Browse files
committed
Update tests to use updated grpc error message
1 parent efbfa57 commit 84848a1

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

jdbc/src/test/java/tech/ydb/jdbc/YdbDriverStaticCredsTest.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
import org.junit.jupiter.api.Test;
1313
import org.junit.jupiter.api.extension.RegisterExtension;
1414

15-
import tech.ydb.jdbc.impl.helper.ExceptionAssert;
1615
import tech.ydb.jdbc.impl.helper.JdbcConnectionExtention;
1716
import tech.ydb.jdbc.impl.helper.JdbcUrlHelper;
1817
import tech.ydb.test.junit5.YdbHelperExtension;
@@ -73,13 +72,14 @@ private void testConnection(ConnectionSupplier connectionSupplier, String userNa
7372
}
7473

7574
private void wrongConnection(ConnectionSupplier connectionSupplier) {
76-
ExceptionAssert.sqlException("Cannot connect to YDB: Discovery failed, "
77-
+ "Cannot get value, code: CLIENT_GRPC_ERROR, issues: ["
78-
+ "gRPC error: (INTERNAL) get token exception (S_ERROR), "
79-
+ "tech.ydb.core.UnexpectedResultException: Can't login, "
75+
SQLException ex = Assertions.assertThrows(SQLException.class, () -> testConnection(connectionSupplier, null));
76+
Assertions.assertTrue(ex.getMessage().startsWith(""
77+
+ "Cannot connect to YDB: Discovery failed, Cannot get value, code: CLIENT_GRPC_ERROR, issues: ["
78+
+ "gRPC error: (INTERNAL)"));
79+
Assertions.assertTrue(ex.getMessage().endsWith(""
80+
+ "get token exception (S_ERROR), tech.ydb.core.UnexpectedResultException: Can't login, "
8081
+ "code: UNAUTHORIZED, issues: [#400020 Invalid password (S_FATAL)] (S_ERROR)], "
81-
+ "Can't login, code: UNAUTHORIZED, issues: [#400020 Invalid password (S_FATAL)]",
82-
() -> testConnection(connectionSupplier, null));
82+
+ "Can't login, code: UNAUTHORIZED, issues: [#400020 Invalid password (S_FATAL)]"));
8383
}
8484

8585
@Test

jdbc/src/test/java/tech/ydb/jdbc/impl/YdbConnectionImplTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -922,7 +922,8 @@ public void testBigBulkAndScan() throws SQLException {
922922

923923
SQLWarning w = ps.getWarnings();
924924
Assertions.assertNotNull(w);
925-
Assertions.assertEquals("gRPC error: (CANCELLED) Cancelled on user request (S_ERROR)", w.getMessage());
925+
Assertions.assertTrue(w.getMessage().startsWith("gRPC error: (CANCELLED)"));
926+
Assertions.assertTrue(w.getMessage().endsWith("Cancelled on user request (S_ERROR)"));
926927

927928
w = w.getNextWarning();
928929
Assertions.assertNotNull(w);

jdbc/src/test/java/tech/ydb/jdbc/impl/YdbTableConnectionImplTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -923,7 +923,8 @@ public void testBigBulkAndScan() throws SQLException {
923923

924924
SQLWarning w = ps.getWarnings();
925925
Assertions.assertNotNull(w);
926-
Assertions.assertEquals("gRPC error: (CANCELLED) Cancelled on user request (S_ERROR)", w.getMessage());
926+
Assertions.assertTrue(w.getMessage().startsWith("gRPC error: (CANCELLED)"));
927+
Assertions.assertTrue(w.getMessage().endsWith("Cancelled on user request (S_ERROR)"));
927928

928929
w = w.getNextWarning();
929930
Assertions.assertNotNull(w);

0 commit comments

Comments
 (0)