afedulov commented on code in PR #19660:
URL: https://github.com/apache/flink/pull/19660#discussion_r876433275
##########
flink-connectors/flink-connector-jdbc/src/test/java/org/apache/flink/connector/jdbc/split/NumericBetweenParametersProviderTest.java:
##########
@@ -116,10 +116,10 @@ public void testBatchNumTooLarge() {
}
private void check(long[][] expected, Serializable[][] actual) {
- assertEquals(expected.length, actual.length);
+ assertThat(actual).hasDimensions(expected.length, 2);
Review Comment:
Could that be `hasDimensions(expected.length, expected[0].length);` ?
##########
flink-connectors/flink-connector-jdbc/src/test/java/org/apache/flink/connector/jdbc/table/JdbcDynamicTableFactoryTest.java:
##########
@@ -282,15 +281,15 @@ public void testJdbcValidation() {
createTableSource(SCHEMA, properties);
fail("exception expected");
} catch (Throwable t) {
- assertTrue(
- ExceptionUtils.findThrowableWithMessage(
+ assertThat(
Review Comment:
assertThatThrownBy?
##########
flink-connectors/flink-connector-jdbc/src/test/java/org/apache/flink/connector/jdbc/table/JdbcDynamicTableFactoryTest.java:
##########
@@ -367,11 +366,11 @@ public void testJdbcValidation() {
createTableSource(SCHEMA, properties);
fail("exception expected");
} catch (Throwable t) {
- assertTrue(
- ExceptionUtils.findThrowableWithMessage(
+ assertThat(
Review Comment:
assertThatThrownBy?
##########
flink-connectors/flink-connector-jdbc/src/test/java/org/apache/flink/connector/jdbc/table/JdbcDynamicTableFactoryTest.java:
##########
@@ -381,11 +380,11 @@ public void testJdbcValidation() {
createTableSource(SCHEMA, properties);
fail("exception expected");
} catch (Throwable t) {
- assertTrue(
- ExceptionUtils.findThrowableWithMessage(
+ assertThat(
Review Comment:
assertThatThrownBy?
##########
flink-connectors/flink-connector-jdbc/src/test/java/org/apache/flink/connector/jdbc/table/JdbcDynamicTableFactoryTest.java:
##########
@@ -264,12 +263,12 @@ public void testJdbcValidation() {
createTableSource(SCHEMA, properties);
fail("exception expected");
} catch (Throwable t) {
- assertTrue(
- ExceptionUtils.findThrowableWithMessage(
+ assertThat(
+ ExceptionUtils.findThrowableWithMessage(
t,
"Either all or none of the following
options should be provided:\n"
- + "username\npassword")
- .isPresent());
+ + "username\npassword"))
Review Comment:
assertThatThrownBy ?
##########
flink-connectors/flink-connector-jdbc/src/test/java/org/apache/flink/connector/jdbc/table/JdbcDynamicTableFactoryTest.java:
##########
@@ -304,12 +303,12 @@ public void testJdbcValidation() {
createTableSource(SCHEMA, properties);
fail("exception expected");
} catch (Throwable t) {
- assertTrue(
- ExceptionUtils.findThrowableWithMessage(
+ assertThat(
+ ExceptionUtils.findThrowableWithMessage(
t,
"'scan.partition.lower-bound'='100' must
not be larger than "
- +
"'scan.partition.upper-bound'='-10'.")
- .isPresent());
+ +
"'scan.partition.upper-bound'='-10'."))
Review Comment:
assertThatThrownBy?
##########
flink-connectors/flink-connector-jdbc/src/test/java/org/apache/flink/connector/jdbc/table/JdbcDynamicTableFactoryTest.java:
##########
@@ -337,13 +336,13 @@ public void testJdbcValidation() {
createTableSource(SCHEMA, properties);
fail("exception expected");
} catch (Throwable t) {
- assertTrue(
- ExceptionUtils.findThrowableWithMessage(
+ assertThat(
Review Comment:
assertThatThrownBy?
##########
flink-connectors/flink-connector-jdbc/src/test/java/org/apache/flink/connector/jdbc/table/JdbcDynamicTableFactoryTest.java:
##########
@@ -320,13 +319,13 @@ public void testJdbcValidation() {
createTableSource(SCHEMA, properties);
fail("exception expected");
} catch (Throwable t) {
- assertTrue(
Review Comment:
assertThatThrownBy?
##########
flink-connectors/flink-connector-jdbc/src/test/java/org/apache/flink/connector/jdbc/table/JdbcDynamicTableFactoryTest.java:
##########
@@ -304,12 +303,12 @@ public void testJdbcValidation() {
createTableSource(SCHEMA, properties);
fail("exception expected");
} catch (Throwable t) {
- assertTrue(
- ExceptionUtils.findThrowableWithMessage(
+ assertThat(
Review Comment:
assertThatThrownBy?
##########
flink-connectors/flink-connector-jdbc/src/test/java/org/apache/flink/connector/jdbc/table/JdbcDynamicTableFactoryTest.java:
##########
@@ -353,11 +352,11 @@ public void testJdbcValidation() {
createTableSource(SCHEMA, properties);
fail("exception expected");
} catch (Throwable t) {
- assertTrue(
- ExceptionUtils.findThrowableWithMessage(
+ assertThat(
Review Comment:
assertThatThrownBy?
##########
flink-connectors/flink-connector-jdbc/src/test/java/org/apache/flink/connector/jdbc/table/JdbcDynamicTableFactoryTest.java:
##########
@@ -337,13 +336,13 @@ public void testJdbcValidation() {
createTableSource(SCHEMA, properties);
fail("exception expected");
} catch (Throwable t) {
- assertTrue(
Review Comment:
assertThatThrownBy?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]