diff --git a/.github/workflows/push_pr.yml b/.github/workflows/push_pr.yml index 6127ba63..d5189ca9 100644 --- a/.github/workflows/push_pr.yml +++ b/.github/workflows/push_pr.yml @@ -25,9 +25,10 @@ jobs: compile_and_test: strategy: matrix: - flink: [1.16.2, 1.17.1, 1.18.0] + flink: [1.16.3, 1.17.2, 1.18.0, 1.19-SNAPSHOT] uses: apache/flink-connector-shared-utils/.github/workflows/ci.yml@ci_utils with: flink_version: ${{ matrix.flink }} timeout_global: 120 - timeout_test: 80 \ No newline at end of file + timeout_test: 80 + diff --git a/.github/workflows/weekly.yml b/.github/workflows/weekly.yml index 4613879e..e72cd6f9 100644 --- a/.github/workflows/weekly.yml +++ b/.github/workflows/weekly.yml @@ -27,13 +27,10 @@ jobs: strategy: matrix: flink_branches: [{ - flink: 1.16.2, + flink: 1.16.3, branch: v3.0 }, { - flink: 1.17.1, - branch: v3.0 - }, { - flink: 1.18.0, + flink: 1.17.2, branch: v3.0 }, { flink: 1.16-SNAPSHOT, @@ -41,9 +38,12 @@ jobs: }, { flink: 1.17-SNAPSHOT, branch: main - }, { + },{ flink: 1.18-SNAPSHOT, branch: main + }, { + flink: 1.19-SNAPSHOT, + branch: main }] uses: apache/flink-connector-shared-utils/.github/workflows/ci.yml@ci_utils with: diff --git a/flink-connector-hbase-2.2/pom.xml b/flink-connector-hbase-2.2/pom.xml index f199d0b6..0bc9ba3a 100644 --- a/flink-connector-hbase-2.2/pom.xml +++ b/flink-connector-hbase-2.2/pom.xml @@ -362,12 +362,6 @@ under the License. org.apache.hadoop hadoop-minicluster test - - - net.minidev - json-smart - - diff --git a/flink-connector-hbase-2.2/src/test/java/org/apache/flink/connector/hbase2/HBaseTablePlanTest.java b/flink-connector-hbase-2.2/src/test/java/org/apache/flink/connector/hbase2/HBaseTablePlanTest.java index 048e08d3..f2c87463 100644 --- a/flink-connector-hbase-2.2/src/test/java/org/apache/flink/connector/hbase2/HBaseTablePlanTest.java +++ b/flink-connector-hbase-2.2/src/test/java/org/apache/flink/connector/hbase2/HBaseTablePlanTest.java @@ -22,15 +22,35 @@ import org.apache.flink.table.planner.utils.StreamTableTestUtil; import org.apache.flink.table.planner.utils.TableTestBase; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInfo; +import org.junit.rules.TestName; -import static org.apache.flink.core.testutils.FlinkMatchers.containsCause; +import static org.assertj.core.api.Assertions.assertThatThrownBy; /** Plan tests for HBase connector, for example, testing projection push down. */ public class HBaseTablePlanTest extends TableTestBase { private final StreamTableTestUtil util = streamTestUtil(TableConfig.getDefault()); + private TestInfo testInfo; + + @BeforeEach + public void setup(TestInfo testInfo) { + this.testInfo = testInfo; + } + + // A workaround to get the test method name for Flink versions not completely migrated to JUnit5 + public TestName name() { + return new TestName() { + @Override + public String getMethodName() { + return testInfo.getTestMethod().get().getName(); + } + }; + } + @Test public void testMultipleRowKey() { util.tableEnv() @@ -45,11 +65,10 @@ public void testMultipleRowKey() { + " 'table-name' = 'my_table'," + " 'zookeeper.quorum' = 'localhost:2021'" + ")"); - thrown().expect( - containsCause( - new IllegalArgumentException( - "Row key can't be set multiple times."))); - util.verifyExecPlan("SELECT * FROM hTable"); + + assertThatThrownBy(() -> util.verifyExecPlan("SELECT * FROM hTable")) + .hasRootCauseInstanceOf(IllegalArgumentException.class) + .hasRootCauseMessage("Row key can't be set multiple times."); } @Test @@ -64,13 +83,13 @@ public void testNoneRowKey() { + " 'table-name' = 'my_table'," + " 'zookeeper.quorum' = 'localhost:2021'" + ")"); - thrown().expect( - containsCause( - new IllegalArgumentException( - "HBase table requires to define a row key field. " - + "A row key field is defined as an atomic type, " - + "column families and qualifiers are defined as ROW type."))); - util.verifyExecPlan("SELECT * FROM hTable"); + + assertThatThrownBy(() -> util.verifyExecPlan("SELECT * FROM hTable")) + .hasRootCauseInstanceOf(IllegalArgumentException.class) + .hasRootCauseMessage( + "HBase table requires to define a row key field. " + + "A row key field is defined as an atomic type, " + + "column families and qualifiers are defined as ROW type."); } @Test @@ -87,13 +106,13 @@ public void testInvalidPrimaryKey() { + " 'table-name' = 'my_table'," + " 'zookeeper.quorum' = 'localhost:2021'" + ")"); - thrown().expect( - containsCause( - new IllegalArgumentException( - "Primary key of HBase table must be defined on the row key field. " - + "A row key field is defined as an atomic type, " - + "column families and qualifiers are defined as ROW type."))); - util.verifyExecPlan("SELECT * FROM hTable"); + + assertThatThrownBy(() -> util.verifyExecPlan("SELECT * FROM hTable")) + .hasRootCauseInstanceOf(IllegalArgumentException.class) + .hasRootCauseMessage( + "Primary key of HBase table must be defined on the row key field. " + + "A row key field is defined as an atomic type, " + + "column families and qualifiers are defined as ROW type."); } @Test @@ -111,11 +130,10 @@ public void testUnsupportedDataType() { + " 'table-name' = 'my_table'," + " 'zookeeper.quorum' = 'localhost:2021'" + ")"); - thrown().expect( - containsCause( - new IllegalArgumentException( - "Unsupported field type 'ARRAY' for HBase."))); - util.verifyExecPlan("SELECT * FROM hTable"); + + assertThatThrownBy(() -> util.verifyExecPlan("SELECT * FROM hTable")) + .hasRootCauseInstanceOf(IllegalArgumentException.class) + .hasRootCauseMessage("Unsupported field type 'ARRAY' for HBase."); } @Test diff --git a/pom.xml b/pom.xml index 172c323e..967aedc0 100644 --- a/pom.xml +++ b/pom.xml @@ -26,7 +26,7 @@ under the License. org.apache.flink flink-connector-parent - 1.0.0 + 1.1.0 org.apache.flink @@ -53,7 +53,7 @@ under the License. - 1.16.2 + 1.16.3 2.12 2.12.7 @@ -190,6 +190,16 @@ under the License. org.apache.flink flink-test-utils ${flink.version} + + + com.google.guava + guava + + + io.dropwizard.metrics + metrics-core + + @@ -350,6 +360,10 @@ under the License. net.minidev json-smart + + org.apache.curator + curator-test + @@ -510,6 +524,12 @@ under the License. assertj-core ${assertj.version} + + + org.xerial.snappy + snappy-java + 1.1.10.4 +