|
12 | 12 | import org.junit.jupiter.api.Test; |
13 | 13 | import org.junit.jupiter.api.extension.RegisterExtension; |
14 | 14 |
|
15 | | -import tech.ydb.jdbc.impl.helper.ExceptionAssert; |
16 | 15 | import tech.ydb.jdbc.impl.helper.JdbcConnectionExtention; |
17 | 16 | import tech.ydb.jdbc.impl.helper.JdbcUrlHelper; |
18 | 17 | import tech.ydb.test.junit5.YdbHelperExtension; |
@@ -73,13 +72,14 @@ private void testConnection(ConnectionSupplier connectionSupplier, String userNa |
73 | 72 | } |
74 | 73 |
|
75 | 74 | 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, " |
80 | 81 | + "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)]")); |
83 | 83 | } |
84 | 84 |
|
85 | 85 | @Test |
|
0 commit comments