From 5276648b4301edb7588edc0311acd47a44c5923f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 3 Oct 2025 03:01:40 +0000 Subject: [PATCH 01/31] Bump org.apache.maven.plugins:maven-enforcer-plugin from 3.5.0 to 3.6.2 Bumps [org.apache.maven.plugins:maven-enforcer-plugin](https://github.com/apache/maven-enforcer) from 3.5.0 to 3.6.2. - [Release notes](https://github.com/apache/maven-enforcer/releases) - [Commits](https://github.com/apache/maven-enforcer/compare/enforcer-3.5.0...enforcer-3.6.2) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-enforcer-plugin dependency-version: 3.6.2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b38ac1ae..f1574da0 100644 --- a/pom.xml +++ b/pom.xml @@ -532,7 +532,7 @@ org.apache.maven.plugins maven-enforcer-plugin - 3.5.0 + 3.6.2 enforce From a2d1c9a660d8c9fdbdeb65f032e20aedb551a456 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Sep 2025 03:03:22 +0000 Subject: [PATCH 02/31] Bump org.mockito:mockito-core from 5.17.0 to 5.20.0 Bumps [org.mockito:mockito-core](https://github.com/mockito/mockito) from 5.17.0 to 5.20.0. - [Release notes](https://github.com/mockito/mockito/releases) - [Commits](https://github.com/mockito/mockito/compare/v5.17.0...v5.20.0) --- updated-dependencies: - dependency-name: org.mockito:mockito-core dependency-version: 5.20.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index f1574da0..68f9d0b4 100644 --- a/pom.xml +++ b/pom.xml @@ -420,7 +420,7 @@ org.mockito mockito-core - 5.17.0 + 5.20.0 test From 8ef6e503861d4dc6acdc01889e0504d92fd3c7b8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Sep 2025 03:01:24 +0000 Subject: [PATCH 03/31] Bump org.apache.maven.plugins:maven-compiler-plugin Bumps [org.apache.maven.plugins:maven-compiler-plugin](https://github.com/apache/maven-compiler-plugin) from 3.13.0 to 3.14.1. - [Release notes](https://github.com/apache/maven-compiler-plugin/releases) - [Commits](https://github.com/apache/maven-compiler-plugin/compare/maven-compiler-plugin-3.13.0...maven-compiler-plugin-3.14.1) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-compiler-plugin dependency-version: 3.14.1 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 68f9d0b4..6a9ad3dc 100644 --- a/pom.xml +++ b/pom.xml @@ -458,7 +458,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.13.0 + 3.14.1 From 592932915e625440263609039b794315201bda5c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Sep 2025 03:01:13 +0000 Subject: [PATCH 04/31] Bump org.apache.maven.plugins:maven-javadoc-plugin from 3.11.2 to 3.12.0 Bumps [org.apache.maven.plugins:maven-javadoc-plugin](https://github.com/apache/maven-javadoc-plugin) from 3.11.2 to 3.12.0. - [Release notes](https://github.com/apache/maven-javadoc-plugin/releases) - [Commits](https://github.com/apache/maven-javadoc-plugin/compare/maven-javadoc-plugin-3.11.2...maven-javadoc-plugin-3.12.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-javadoc-plugin dependency-version: 3.12.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 6a9ad3dc..229a8c5f 100644 --- a/pom.xml +++ b/pom.xml @@ -675,7 +675,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.11.2 + 3.12.0 8 From c7f53ca9ded6059794c69d8facdbb9fc20cf1bd9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 3 Jul 2025 03:13:00 +0000 Subject: [PATCH 05/31] Bump org.apache.maven.plugins:maven-gpg-plugin from 3.2.7 to 3.2.8 Bumps [org.apache.maven.plugins:maven-gpg-plugin](https://github.com/apache/maven-gpg-plugin) from 3.2.7 to 3.2.8. - [Release notes](https://github.com/apache/maven-gpg-plugin/releases) - [Commits](https://github.com/apache/maven-gpg-plugin/compare/maven-gpg-plugin-3.2.7...maven-gpg-plugin-3.2.8) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-gpg-plugin dependency-version: 3.2.8 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 229a8c5f..84c89095 100644 --- a/pom.xml +++ b/pom.xml @@ -653,7 +653,7 @@ org.apache.maven.plugins maven-gpg-plugin - 3.2.7 + 3.2.8 sign-artifacts From 489a0a5591b0a8ecaeee9d49f9f2f6dd01b03f98 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 5 Jun 2025 03:08:18 +0000 Subject: [PATCH 06/31] Bump org.codehaus.mojo:build-helper-maven-plugin from 3.6.0 to 3.6.1 Bumps [org.codehaus.mojo:build-helper-maven-plugin](https://github.com/mojohaus/build-helper-maven-plugin) from 3.6.0 to 3.6.1. - [Release notes](https://github.com/mojohaus/build-helper-maven-plugin/releases) - [Commits](https://github.com/mojohaus/build-helper-maven-plugin/compare/3.6.0...3.6.1) --- updated-dependencies: - dependency-name: org.codehaus.mojo:build-helper-maven-plugin dependency-version: 3.6.1 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- dbeam-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbeam-bom/pom.xml b/dbeam-bom/pom.xml index 4e7d364e..5c6d6e56 100644 --- a/dbeam-bom/pom.xml +++ b/dbeam-bom/pom.xml @@ -47,7 +47,7 @@ org.codehaus.mojo build-helper-maven-plugin - 3.6.0 + 3.6.1 attach-effective-pom From ea7e26ac51f9a72cb19c77d1522ec4f24270c674 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 27 Feb 2025 04:54:19 +0000 Subject: [PATCH 07/31] Bump org.apache.maven.plugins:maven-project-info-reports-plugin Bumps [org.apache.maven.plugins:maven-project-info-reports-plugin](https://github.com/apache/maven-project-info-reports-plugin) from 3.8.0 to 3.9.0. - [Release notes](https://github.com/apache/maven-project-info-reports-plugin/releases) - [Commits](https://github.com/apache/maven-project-info-reports-plugin/compare/maven-project-info-reports-plugin-3.8.0...maven-project-info-reports-plugin-3.9.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-project-info-reports-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 84c89095..715a8374 100644 --- a/pom.xml +++ b/pom.xml @@ -519,7 +519,7 @@ org.apache.maven.plugins maven-project-info-reports-plugin - 3.8.0 + 3.9.0 maven-surefire-plugin From 8e4a759ecef18cbca59943f490a3caad32588ee0 Mon Sep 17 00:00:00 2001 From: Luis Bianchin Date: Tue, 7 Apr 2026 15:19:59 +0200 Subject: [PATCH 08/31] Bump PostgreSQL JDBC driver from 42.7.4 to 42.7.7 Fixes CVE-2025-49146 (https://nvd.nist.gov/vuln/detail/CVE-2025-49146) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 715a8374..4b690bc6 100644 --- a/pom.xml +++ b/pom.xml @@ -138,7 +138,7 @@ 4.13.2 8.4.0 3.5.3 - 42.7.4 + 42.7.7 1.18.0 From 50dd3dc6655eeb361e5784294207de9eebdf13f2 Mon Sep 17 00:00:00 2001 From: Luis Bianchin Date: Tue, 7 Apr 2026 16:16:18 +0200 Subject: [PATCH 09/31] Bump Avro from 1.11.4 to 1.11.5 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4b690bc6..26d49486 100644 --- a/pom.xml +++ b/pom.xml @@ -110,7 +110,7 @@ 2.65.0 1.9 - 1.11.4 + 1.11.5 3.42.0 1.17.1 1.26.2 From 94307a9fe954c5501fcc286386ad34efb993680f Mon Sep 17 00:00:00 2001 From: Luis Bianchin Date: Tue, 7 Apr 2026 16:15:20 +0200 Subject: [PATCH 10/31] Bump Apache Beam SDK from 2.65.0 to 2.72.0 Beam 2.65.0 reaches end-of-support in May 2026. Beam 2.72.0 is the latest stable release, supported until March 2027. Updated dependency versions to match Beam 2.72.0: - errorprone: 2.10.0 -> 2.31.0 - joda-time: 2.10.14 -> 2.14.0 - netty: 4.1.121.Final -> 4.1.124.Final - slf4j: 1.7.30 -> 2.0.16 - google-cloud-libraries-bom: 26.57.0 -> 26.76.0 Added dependency management overrides to resolve version convergence between Beam BOM and libraries-bom: - jackson-dataformat-xml 2.18.2 (from google-cloud-storage) - google-cloud-bigtable 2.73.1 and proto stubs (from beam-io-gcp) - j2objc-annotations 3.1 (from libraries-bom) - failureaccess 1.0.3 (from transitives) --- pom.xml | 55 +++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 47 insertions(+), 8 deletions(-) diff --git a/pom.xml b/pom.xml index 26d49486..1914b853 100644 --- a/pom.xml +++ b/pom.xml @@ -106,30 +106,30 @@ UTF-8 - - 2.65.0 + + 2.72.0 1.9 1.11.5 3.42.0 1.17.1 1.26.2 - 2.10.0 + 2.31.0 33.1.0-jre 2.1 4.5.13 4.4.14 2.15.4 - 2.10.14 - 4.1.121.Final - 1.7.30 + 2.14.0 + 4.1.124.Final + 2.0.16 1.6.8 1.5.6-3 - - 26.57.0 + + 26.76.0 0.31.1 @@ -238,6 +238,45 @@ opencensus-contrib-grpc-metrics ${opencensus.version} + + + com.fasterxml.jackson.dataformat + jackson-dataformat-xml + 2.18.2 + + + + com.google.cloud + google-cloud-bigtable + 2.73.1 + + + com.google.api.grpc + grpc-google-cloud-bigtable-v2 + 2.73.1 + + + com.google.api.grpc + proto-google-cloud-bigtable-v2 + 2.73.1 + + + com.google.api.grpc + proto-google-cloud-bigtable-admin-v2 + 2.73.1 + + + + com.google.j2objc + j2objc-annotations + 3.1 + + + + com.google.guava + failureaccess + 1.0.3 + From 8f94e325e93bd186ea74a3a43c9744abd5011525 Mon Sep 17 00:00:00 2001 From: Luis Bianchin Date: Tue, 7 Apr 2026 16:17:56 +0200 Subject: [PATCH 11/31] Bump Jackson from 2.15.4 to 2.18.2 Aligns with the version provided by google-cloud-libraries-bom 26.76.0, removing the separate jackson-dataformat-xml override. --- pom.xml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/pom.xml b/pom.xml index 1914b853..b01abde2 100644 --- a/pom.xml +++ b/pom.xml @@ -119,7 +119,7 @@ 2.1 4.5.13 4.4.14 - 2.15.4 + 2.18.2 2.14.0 4.1.124.Final 2.0.16 @@ -238,12 +238,6 @@ opencensus-contrib-grpc-metrics ${opencensus.version} - - - com.fasterxml.jackson.dataformat - jackson-dataformat-xml - 2.18.2 - com.google.cloud From 56ed88fe5bd267e3b6b3234fa098062d450d6988 Mon Sep 17 00:00:00 2001 From: Luis Bianchin Date: Tue, 7 Apr 2026 16:23:02 +0200 Subject: [PATCH 12/31] Bump Guava from 33.1.0-jre to 33.5.0-jre Aligns with the version provided by google-cloud-libraries-bom 26.76.0. --- pom.xml | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/pom.xml b/pom.xml index b01abde2..2e7aa713 100644 --- a/pom.xml +++ b/pom.xml @@ -115,7 +115,7 @@ 1.17.1 1.26.2 2.31.0 - 33.1.0-jre + 33.5.0-jre 2.1 4.5.13 4.4.14 @@ -259,18 +259,6 @@ proto-google-cloud-bigtable-admin-v2 2.73.1 - - - com.google.j2objc - j2objc-annotations - 3.1 - - - - com.google.guava - failureaccess - 1.0.3 - From 1526fa0b11e51b20a9881c924ab8b81a564f142b Mon Sep 17 00:00:00 2001 From: Luis Bianchin Date: Tue, 7 Apr 2026 16:32:35 +0200 Subject: [PATCH 13/31] Bump PostgreSQL JDBC driver from 42.7.7 to 42.7.8 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 2e7aa713..b16b0305 100644 --- a/pom.xml +++ b/pom.xml @@ -138,7 +138,7 @@ 4.13.2 8.4.0 3.5.3 - 42.7.7 + 42.7.8 1.18.0 From 46e52481dc0ac5ccede461da8559db78408948d6 Mon Sep 17 00:00:00 2001 From: Luis Bianchin Date: Tue, 7 Apr 2026 16:35:07 +0200 Subject: [PATCH 14/31] Bump google-api-services-cloudkms from v1-rev20240314 to v1-rev20260319 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b16b0305..0dd025c3 100644 --- a/pom.xml +++ b/pom.xml @@ -286,7 +286,7 @@ com.google.apis google-api-services-cloudkms - v1-rev20240314-2.0.0 + v1-rev20260319-2.0.0 From d1111806b3ae54bc9b8f28849dffb1ff7716ffbd Mon Sep 17 00:00:00 2001 From: Luis Bianchin Date: Tue, 7 Apr 2026 16:36:56 +0200 Subject: [PATCH 15/31] Bump MariaDB JDBC driver from 3.5.3 to 3.5.8 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 0dd025c3..9ac8fbb4 100644 --- a/pom.xml +++ b/pom.xml @@ -137,7 +137,7 @@ 1.78.1 4.13.2 8.4.0 - 3.5.3 + 3.5.8 42.7.8 1.18.0 From 998d2c9b35a941a195b79f3150df591f9a24220e Mon Sep 17 00:00:00 2001 From: Luis Bianchin Date: Tue, 7 Apr 2026 16:39:55 +0200 Subject: [PATCH 16/31] Bump zstd-jni from 1.5.6-3 to 1.5.7-7 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9ac8fbb4..9f888229 100644 --- a/pom.xml +++ b/pom.xml @@ -124,7 +124,7 @@ 4.1.124.Final 2.0.16 1.6.8 - 1.5.6-3 + 1.5.7-7 From ad07d124ceff0867593b70517e0c2cda1b182d1e Mon Sep 17 00:00:00 2001 From: Luis Bianchin Date: Tue, 7 Apr 2026 16:43:26 +0200 Subject: [PATCH 17/31] Bump Cloud SQL socket factory from 1.18.0 to 1.25.0 1.25.0 is the highest version compatible with the current libraries-bom 26.76.0 without introducing dependency conflicts. Versions >= 1.25.1 require a newer google-api-client than what the BOM provides. --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9f888229..388402f2 100644 --- a/pom.xml +++ b/pom.xml @@ -139,7 +139,7 @@ 8.4.0 3.5.8 42.7.8 - 1.18.0 + 1.25.0 From 900fc1a91e6d702f4781487a66ed5c7c8e935ea5 Mon Sep 17 00:00:00 2001 From: Luis Bianchin Date: Tue, 7 Apr 2026 17:01:54 +0200 Subject: [PATCH 18/31] Update avro-tools download URL to 1.11.5 in CI workflow The previous URL for avro-tools 1.11.3 is no longer available on dlcdn.apache.org, causing CI failures. --- .github/workflows/maven.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index c20bf249..6799ab3a 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -52,11 +52,11 @@ jobs: - name: Install avro tools if: matrix.java_version == '17' run: | - wget https://dlcdn.apache.org/avro/avro-1.11.3/java/avro-tools-1.11.3.jar + wget https://dlcdn.apache.org/avro/avro-1.11.5/java/avro-tools-1.11.5.jar mkdir -p /opt/avro - mv avro-tools-1.11.3.jar /opt/avro/ - chmod +x /opt/avro/avro-tools-1.11.3.jar - echo "alias avro-tools='java -jar /opt/avro/avro-tools-1.11.3.jar'" > ~/.bashrc + mv avro-tools-1.11.5.jar /opt/avro/ + chmod +x /opt/avro/avro-tools-1.11.5.jar + echo "alias avro-tools='java -jar /opt/avro/avro-tools-1.11.5.jar'" > ~/.bashrc - name: End to end tests shell: bash if: matrix.java_version == '17' From 067cc76a1280bbc97f17099db10f7e9e3bbda99d Mon Sep 17 00:00:00 2001 From: Luis Bianchin Date: Mon, 4 May 2026 12:00:51 +0200 Subject: [PATCH 19/31] Bump Apache Beam SDK from 2.72.0 to 2.73.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also bump google-cloud libraries-bom from 26.76.0 to 26.79.0 (the version that Beam 2.73 expects) and remove the now-stale google-cloud-bigtable 2.73.1 overrides — libraries-bom 26.79.0 plus the Beam BOM converge cleanly without them. Co-Authored-By: Claude --- pom.xml | 29 ++++------------------------- 1 file changed, 4 insertions(+), 25 deletions(-) diff --git a/pom.xml b/pom.xml index 388402f2..3ca18054 100644 --- a/pom.xml +++ b/pom.xml @@ -106,8 +106,8 @@ UTF-8 - - 2.72.0 + + 2.73.0 1.9 1.11.5 @@ -128,8 +128,8 @@ - - 26.76.0 + + 26.79.0 0.31.1 @@ -238,27 +238,6 @@ opencensus-contrib-grpc-metrics ${opencensus.version} - - - com.google.cloud - google-cloud-bigtable - 2.73.1 - - - com.google.api.grpc - grpc-google-cloud-bigtable-v2 - 2.73.1 - - - com.google.api.grpc - proto-google-cloud-bigtable-v2 - 2.73.1 - - - com.google.api.grpc - proto-google-cloud-bigtable-admin-v2 - 2.73.1 - From e02a1e2811da62c2fc1f6365c157d988640959bb Mon Sep 17 00:00:00 2001 From: Luis Bianchin Date: Mon, 4 May 2026 12:08:23 +0200 Subject: [PATCH 20/31] Bump BouncyCastle from 1.78.1 to 1.84 Routine update for the BouncyCastle crypto provider; pulls in fixes across 1.79, 1.80, 1.81, 1.82, 1.83, and 1.84 releases (April 2026). Co-Authored-By: Claude --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3ca18054..76b58cd1 100644 --- a/pom.xml +++ b/pom.xml @@ -134,7 +134,7 @@ 0.31.1 - 1.78.1 + 1.84 4.13.2 8.4.0 3.5.8 From e5896776e748a24b2f3bbba110495aff134e9d7c Mon Sep 17 00:00:00 2001 From: Luis Bianchin Date: Mon, 4 May 2026 12:08:44 +0200 Subject: [PATCH 21/31] Bump Checkstyle from 10.23.0 to 10.26.1 Update to the latest 10.x release (last line that supports JDK 8/11 toolchains; 11.x requires JDK 17 to run the plugin). Co-Authored-By: Claude --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 76b58cd1..ee30c7c6 100644 --- a/pom.xml +++ b/pom.xml @@ -633,7 +633,7 @@ com.puppycrawl.tools checkstyle - 10.23.0 + 10.26.1 From 09af448c5b838da9d6d3e4379b497770e67e7b1d Mon Sep 17 00:00:00 2001 From: Luis Bianchin Date: Mon, 4 May 2026 12:09:11 +0200 Subject: [PATCH 22/31] Bump maven-surefire-plugin from 3.5.3 to 3.5.5 Co-Authored-By: Claude --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ee30c7c6..30fbdcfa 100644 --- a/pom.xml +++ b/pom.xml @@ -523,7 +523,7 @@ maven-surefire-plugin - 3.5.3 + 3.5.5 true From ac4625b84c72cfac89b9e4486db9249be39955fe Mon Sep 17 00:00:00 2001 From: Luis Bianchin Date: Mon, 4 May 2026 12:09:34 +0200 Subject: [PATCH 23/31] Bump maven-shade-plugin from 3.6.0 to 3.6.2 Co-Authored-By: Claude --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 30fbdcfa..109f489c 100644 --- a/pom.xml +++ b/pom.xml @@ -732,7 +732,7 @@ org.apache.maven.plugins maven-shade-plugin - 3.6.0 + 3.6.2 bundle-and-repackage From 9f5ff69bd22798b7d62086490a45007e2e1c72af Mon Sep 17 00:00:00 2001 From: Luis Bianchin Date: Mon, 4 May 2026 12:15:03 +0200 Subject: [PATCH 24/31] Use Java 21 on deploy --- .github/workflows/maven.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 6799ab3a..9df04ab8 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -86,12 +86,12 @@ jobs: uses: actions/cache@v4 with: path: ~/.m2 - key: Linux-java11-m2-${{ hashFiles('**/pom.xml') }} - restore-keys: Linux-java11-m2 - - name: Set up JDK 11 + key: Linux-java21-m2-${{ hashFiles('**/pom.xml') }} + restore-keys: Linux-java21-m2 + - name: Set up JDK 21 uses: actions/setup-java@v4 with: - java-version: '11' + java-version: '21' distribution: 'adopt' # use Corretto once supported https://github.com/actions/setup-java/issues/68 - name: Deploy env: From 774604ef6ac623897e26d45e688c5faacd292e7d Mon Sep 17 00:00:00 2001 From: Luis Bianchin Date: Mon, 4 May 2026 12:16:03 +0200 Subject: [PATCH 25/31] Test with Java 25 --- .github/workflows/maven.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 9df04ab8..73ce5b54 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -21,7 +21,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - java_version: ['11', '17', '21'] + java_version: ['11', '17', '21', '25'] os: [ubuntu-latest] steps: - uses: actions/checkout@v4 From e1616da88d378a08a7e9d79138587a5d9e2bf6ba Mon Sep 17 00:00:00 2001 From: Luis Bianchin Date: Mon, 4 May 2026 12:16:35 +0200 Subject: [PATCH 26/31] Java 21 for e2e tests --- .github/workflows/maven.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 73ce5b54..55f2d65a 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -50,7 +50,7 @@ jobs: fail_ci_if_error: false # optional (default = false) verbose: true # optional (default = false) - name: Install avro tools - if: matrix.java_version == '17' + if: matrix.java_version == '21' run: | wget https://dlcdn.apache.org/avro/avro-1.11.5/java/avro-tools-1.11.5.jar mkdir -p /opt/avro @@ -59,12 +59,12 @@ jobs: echo "alias avro-tools='java -jar /opt/avro/avro-tools-1.11.5.jar'" > ~/.bashrc - name: End to end tests shell: bash - if: matrix.java_version == '17' + if: matrix.java_version == '21' run: ./e2e/e2e.sh - run: mkdir staging && cp /tmp/debeam_e2e.log ./staging - if: matrix.java_version == '17' + if: matrix.java_version == '21' - uses: actions/upload-artifact@v4 - if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main') && matrix.java_version == '17' + if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main') && matrix.java_version == '21' with: name: Package path: staging From e2858f1c2bc6d8f16ad9a459040435773b21b884 Mon Sep 17 00:00:00 2001 From: Luis Bianchin Date: Mon, 4 May 2026 13:06:35 +0200 Subject: [PATCH 27/31] Support Java 25 build JDK 23 (JEP 472) disabled implicit annotation processing, so AutoValue silently stopped generating AutoValue_* classes on JDK 25. Declare the processor explicitly via maven-compiler-plugin's annotationProcessorPaths so javac runs it again, and bump auto-value 1.9 -> 1.11.0 for JDK 23+ compiler-internals support. Bump maven.compiler.release 8 -> 11 to drop the obsolete-source-8 warnings; matches the enforcer's existing [11,) floor. Co-Authored-By: Claude --- pom.xml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 109f489c..987ed8ce 100644 --- a/pom.xml +++ b/pom.xml @@ -101,7 +101,7 @@ - 8 + 11 UTF-8 UTF-8 @@ -109,7 +109,7 @@ 2.73.0 - 1.9 + 1.11.0 1.11.5 3.42.0 1.17.1 @@ -459,6 +459,17 @@ org.apache.maven.plugins maven-compiler-plugin 3.14.1 + + + + + com.google.auto.value + auto-value + ${auto-value.version} + + + From df0dc82a19021166d2307e879298322689e9571d Mon Sep 17 00:00:00 2001 From: Luis Bianchin Date: Wed, 13 May 2026 08:58:12 +0200 Subject: [PATCH 28/31] Migrate parent POM from JUnit 4 to JUnit 5 Replace junit:junit 4.13.2 dependency management with JUnit 5 BOM (junit-bom 5.11.4) and add mockito-junit-jupiter for extension support. --- pom.xml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 987ed8ce..ff02d27f 100644 --- a/pom.xml +++ b/pom.xml @@ -135,7 +135,7 @@ 1.84 - 4.13.2 + 5.11.4 8.4.0 3.5.8 42.7.8 @@ -400,10 +400,11 @@ - junit - junit - ${junit.version} - test + org.junit + junit-bom + ${junit-jupiter.version} + pom + import org.hamcrest @@ -423,6 +424,12 @@ 5.20.0 test + + org.mockito + mockito-junit-jupiter + 5.20.0 + test + com.h2database h2 From 5584ba4690c3853d4539975be718c608c5b00b2b Mon Sep 17 00:00:00 2001 From: Luis Bianchin Date: Wed, 13 May 2026 09:04:07 +0200 Subject: [PATCH 29/31] Migrate dbeam-core tests from JUnit 4 to JUnit 5 Replace JUnit 4 annotations and assertions with JUnit 5 equivalents: - @BeforeClass/@AfterClass -> @BeforeAll/@AfterAll - @Ignore -> @Disabled - @Test(expected=...) -> assertThrows() - Assert -> Assertions (with swapped message parameter order) - org.junit.* imports -> org.junit.jupiter.api.* --- dbeam-core/pom.xml | 4 +- .../dbeam/args/JdbcExportOptionsTest.java | 241 ++++++++++-------- .../dbeam/args/ParallelQueryBuilderTest.java | 6 +- .../dbeam/args/QueryBuilderArgsTest.java | 55 ++-- .../spotify/dbeam/args/QueryBuilderTest.java | 30 +-- .../dbeam/avro/JdbcAvroRecordTest.java | 81 +++--- .../dbeam/avro/JdbcAvroSchemaTest.java | 68 ++--- .../dbeam/avro/PostgresJdbcAvroTest.java | 118 ++++++--- .../spotify/dbeam/beam/BeamHelperTest.java | 13 +- .../spotify/dbeam/jobs/BeamHelperTest.java | 20 +- .../dbeam/jobs/BenchJdbcAvroJobTest.java | 6 +- .../spotify/dbeam/jobs/JdbcAvroJobTest.java | 68 ++--- .../spotify/dbeam/jobs/PsqlAvroJobTest.java | 2 +- .../dbeam/jobs/PsqlReplicationCheckTest.java | 42 +-- .../dbeam/options/ArrayHandlingModeTest.java | 24 +- .../dbeam/options/InputAvroSchemaTest.java | 54 ++-- .../options/JobNameConfigurationTest.java | 12 +- .../dbeam/options/PasswordReaderTest.java | 14 +- 18 files changed, 479 insertions(+), 379 deletions(-) diff --git a/dbeam-core/pom.xml b/dbeam-core/pom.xml index 6e2cd66e..2bfa3ba9 100644 --- a/dbeam-core/pom.xml +++ b/dbeam-core/pom.xml @@ -93,8 +93,8 @@ - junit - junit + org.junit.jupiter + junit-jupiter test diff --git a/dbeam-core/src/test/java/com/spotify/dbeam/args/JdbcExportOptionsTest.java b/dbeam-core/src/test/java/com/spotify/dbeam/args/JdbcExportOptionsTest.java index d6a0faf4..d87062a3 100644 --- a/dbeam-core/src/test/java/com/spotify/dbeam/args/JdbcExportOptionsTest.java +++ b/dbeam-core/src/test/java/com/spotify/dbeam/args/JdbcExportOptionsTest.java @@ -33,21 +33,21 @@ import org.apache.avro.file.CodecFactory; import org.apache.beam.sdk.options.PipelineOptions; import org.apache.beam.sdk.options.PipelineOptionsFactory; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; public class JdbcExportOptionsTest { private static File sqlFile; - @BeforeClass + @BeforeAll public static void beforeAll() throws IOException { sqlFile = File.createTempFile("query", ".sql"); sqlFile.deleteOnExit(); } - @AfterClass + @AfterAll public static void afterAll() throws IOException { Files.delete(sqlFile.toPath()); } @@ -63,27 +63,33 @@ JdbcExportArgs optionsFromArgs(String[] cmdLineArgs) throws IOException, ClassNo return JdbcExportArgsFactory.fromPipelineOptions(opts); } - @Test(expected = IllegalArgumentException.class) - public void shouldFailParseOnInvalidArg() throws IOException, ClassNotFoundException { - optionsFromArgs("--foo=bar"); + @Test + public void shouldFailParseOnInvalidArg() { + Assertions.assertThrows(IllegalArgumentException.class, () -> optionsFromArgs("--foo=bar")); } - @Test(expected = IllegalArgumentException.class) - public void shouldFailOnMissingConnectionUrl() throws IOException, ClassNotFoundException { - optionsFromArgs("--table=sometable"); + @Test + public void shouldFailOnMissingConnectionUrl() { + Assertions.assertThrows( + IllegalArgumentException.class, () -> optionsFromArgs("--table=sometable")); } - @Test(expected = IllegalArgumentException.class) - public void shouldFailOnMissingTableAndSqlFile() throws IOException, ClassNotFoundException { - optionsFromArgs("--connectionUrl=jdbc:postgresql://some_db"); + @Test + public void shouldFailOnMissingTableAndSqlFile() { + Assertions.assertThrows( + IllegalArgumentException.class, + () -> optionsFromArgs("--connectionUrl=jdbc:postgresql://some_db")); } - @Test(expected = IllegalArgumentException.class) - public void shouldFailOnTableAndSqlFilePresent() throws IOException, ClassNotFoundException { - optionsFromArgs( - "--connectionUrl=jdbc:postgresql://some_db --sqlFile=" - + sqlFile.getAbsolutePath() - + " --table=some_table"); + @Test + public void shouldFailOnTableAndSqlFilePresent() { + Assertions.assertThrows( + IllegalArgumentException.class, + () -> + optionsFromArgs( + "--connectionUrl=jdbc:postgresql://some_db --sqlFile=" + + sqlFile.getAbsolutePath() + + " --table=some_table")); } @Test @@ -100,7 +106,7 @@ public void shouldNotFailOnMissingTableSqlFile() throws IOException, ClassNotFou QueryBuilderArgs.createFromQuery( com.google.common.io.Files.asCharSource(sqlFile, StandardCharsets.UTF_8).read())); - Assert.assertEquals(expected, actual); + Assertions.assertEquals(expected, actual); } @Test @@ -116,7 +122,7 @@ public void shouldParseWithDefaultsOnConnectionUrlAndTable() .withUsername("dbeam-extractor")), QueryBuilderArgs.create("some_table")); - Assert.assertEquals(expected, actual); + Assertions.assertEquals(expected, actual); } @Test @@ -130,56 +136,77 @@ public void shouldParseWithMySqlConnection() throws IOException, ClassNotFoundEx JdbcConnectionArgs.create("jdbc:mysql://some_db").withUsername("dbeam-extractor")), QueryBuilderArgs.create("some_table")); - Assert.assertEquals(expected, actual); + Assertions.assertEquals(expected, actual); } - @Test(expected = IllegalArgumentException.class) - public void shouldFailOnInvalidTable() throws IOException, ClassNotFoundException { - optionsFromArgs("--connectionUrl=jdbc:postgresql://some_db --table=some-table-with-dash"); + @Test + public void shouldFailOnInvalidTable() { + Assertions.assertThrows( + IllegalArgumentException.class, + () -> + optionsFromArgs( + "--connectionUrl=jdbc:postgresql://some_db --table=some-table-with-dash")); } - @Test(expected = IllegalArgumentException.class) - public void shouldFailOnNonJdbcUrl() throws IOException, ClassNotFoundException { - optionsFromArgs("--connectionUrl=bar --table=sometable"); + @Test + public void shouldFailOnNonJdbcUrl() { + Assertions.assertThrows( + IllegalArgumentException.class, + () -> optionsFromArgs("--connectionUrl=bar --table=sometable")); } - @Test(expected = IllegalArgumentException.class) - public void shouldFailOnUnsupportedJdbcUrl() throws IOException, ClassNotFoundException { - optionsFromArgs("--connectionUrl=jdbc:paradox:./foo --table=sometable"); + @Test + public void shouldFailOnUnsupportedJdbcUrl() { + Assertions.assertThrows( + IllegalArgumentException.class, + () -> optionsFromArgs("--connectionUrl=jdbc:paradox:./foo --table=sometable")); } - @Test(expected = IllegalArgumentException.class) - public void shouldFailOnMissingPartitionButPresentPartitionColumn() - throws IOException, ClassNotFoundException { - optionsFromArgs( - "--connectionUrl=jdbc:postgresql://some_db --table=sometable " + "--partitionColumn=col"); + @Test + public void shouldFailOnMissingPartitionButPresentPartitionColumn() { + Assertions.assertThrows( + IllegalArgumentException.class, + () -> + optionsFromArgs( + "--connectionUrl=jdbc:postgresql://some_db --table=sometable " + + "--partitionColumn=col")); } - @Test(expected = IllegalArgumentException.class) - public void shouldFailOnTooOldPartition() throws IOException, ClassNotFoundException { - optionsFromArgs( - "--connectionUrl=jdbc:postgresql://some_db --table=sometable " + "--partition=2015-01-01"); + @Test + public void shouldFailOnTooOldPartition() { + Assertions.assertThrows( + IllegalArgumentException.class, + () -> + optionsFromArgs( + "--connectionUrl=jdbc:postgresql://some_db --table=sometable " + + "--partition=2015-01-01")); } - @Test(expected = IllegalArgumentException.class) - public void shouldFailOnTooOldPartitionWithConfiguredMinPartitionPeriodMoreThanPartition() - throws IOException, ClassNotFoundException { - optionsFromArgs( - "--connectionUrl=jdbc:postgresql://some_db --table=sometable " - + "--partition=2015-01-01 --minPartitionPeriod=2015-01-02"); + @Test + public void shouldFailOnTooOldPartitionWithConfiguredMinPartitionPeriodMoreThanPartition() { + Assertions.assertThrows( + IllegalArgumentException.class, + () -> + optionsFromArgs( + "--connectionUrl=jdbc:postgresql://some_db --table=sometable " + + "--partition=2015-01-01 --minPartitionPeriod=2015-01-02")); } - @Test(expected = IllegalArgumentException.class) - public void shouldFailOnTooOldPartitionWithConfiguredMinPartitionPeriodLessThanPartition() - throws IOException, ClassNotFoundException { - optionsFromArgs( - "--connectionUrl=jdbc:postgresql://some_db --table=sometable " - + "--partition=2015-01-01 --minPartitionPeriod=2015-01-01"); + @Test + public void shouldFailOnTooOldPartitionWithConfiguredMinPartitionPeriodLessThanPartition() { + Assertions.assertThrows( + IllegalArgumentException.class, + () -> + optionsFromArgs( + "--connectionUrl=jdbc:postgresql://some_db --table=sometable " + + "--partition=2015-01-01 --minPartitionPeriod=2015-01-01")); } - @Test(expected = IllegalArgumentException.class) - public void shouldFailOnNonJdbcUrl2() throws IOException, ClassNotFoundException { - optionsFromArgs("--connectionUrl=some:foo:bar --table=sometable"); + @Test + public void shouldFailOnNonJdbcUrl2() { + Assertions.assertThrows( + IllegalArgumentException.class, + () -> optionsFromArgs("--connectionUrl=some:foo:bar --table=sometable")); } @Test @@ -197,7 +224,7 @@ public void shouldConfigureUserAndPassword() throws IOException, ClassNotFoundEx .withPassword("somepassword")), QueryBuilderArgs.create("some_table")); - Assert.assertEquals(expected, actual); + Assertions.assertEquals(expected, actual); } @Test @@ -207,7 +234,7 @@ public void shouldConfigureAvroLogicalTypes() throws IOException, ClassNotFoundE "--connectionUrl=jdbc:postgresql://some_db --table=some_table " + "--password=secret --useAvroLogicalTypes=true"); - Assert.assertTrue(options.useAvroLogicalTypes()); + Assertions.assertTrue(options.useAvroLogicalTypes()); } @Test @@ -217,7 +244,7 @@ public void shouldConfigureAvroDoc() throws IOException, ClassNotFoundException "--connectionUrl=jdbc:postgresql://some_db --table=some_table " + "--password=secret --avroDoc=somedoc"); - Assert.assertEquals(Optional.of("somedoc"), options.avroDoc()); + Assertions.assertEquals(Optional.of("somedoc"), options.avroDoc()); } @Test @@ -227,7 +254,7 @@ public void shouldConfigureAvroSchemaNamespace() throws IOException, ClassNotFou "--connectionUrl=jdbc:postgresql://some_db --table=some_table " + "--password=secret --avroSchemaNamespace=ns"); - Assert.assertEquals("ns", options.avroSchemaNamespace()); + Assertions.assertEquals("ns", options.avroSchemaNamespace()); } @Test @@ -238,7 +265,7 @@ public void shouldDefaultOutputDataOnlyToFalse() throws IOException, ClassNotFou "--connectionUrl=jdbc:postgresql://some_db", "--table=some_table", "--password=secret" }); - Assert.assertEquals(false, defaultDataOnlyoptions.as(OutputOptions.class).getDataOnly()); + Assertions.assertEquals(false, defaultDataOnlyoptions.as(OutputOptions.class).getDataOnly()); } @Test @@ -252,7 +279,7 @@ public void shouldConfigureOutputDataOnly() throws IOException, ClassNotFoundExc "--dataOnly" }); - Assert.assertEquals(true, options.as(OutputOptions.class).getDataOnly()); + Assertions.assertEquals(true, options.as(OutputOptions.class).getDataOnly()); } @Test @@ -262,7 +289,7 @@ public void shouldConfigureFetchSize() throws IOException, ClassNotFoundExceptio "--connectionUrl=jdbc:postgresql://some_db --table=some_table " + "--password=secret --fetchSize=1234"); - Assert.assertEquals(1234, options.jdbcAvroOptions().fetchSize()); + Assertions.assertEquals(1234, options.jdbcAvroOptions().fetchSize()); } @Test @@ -274,7 +301,7 @@ public void shouldSupportMonthlyPartitionPeriod() throws IOException, ClassNotFo "--connectionUrl=jdbc:postgresql://some_db --table=some_table " + "--password=secret --partitionPeriod=P1M --partition=2050-12"); - Assert.assertEquals(Period.ofMonths(1), options.queryBuilderArgs().partitionPeriod()); + Assertions.assertEquals(Period.ofMonths(1), options.queryBuilderArgs().partitionPeriod()); } @Test @@ -284,8 +311,8 @@ public void shouldConfigureDeflateCodec() throws IOException, ClassNotFoundExcep "--connectionUrl=jdbc:postgresql://some_db --table=some_table " + "--password=secret --avroCodec=deflate7"); - Assert.assertEquals("deflate7", options.jdbcAvroOptions().avroCodec()); - Assert.assertEquals( + Assertions.assertEquals("deflate7", options.jdbcAvroOptions().avroCodec()); + Assertions.assertEquals( CodecFactory.deflateCodec(7).toString(), options.jdbcAvroOptions().getCodecFactory().toString()); } @@ -297,8 +324,8 @@ public void shouldConfigureZstandardCodec() throws IOException, ClassNotFoundExc "--connectionUrl=jdbc:postgresql://some_db --table=some_table " + "--password=secret --avroCodec=zstandard9"); - Assert.assertEquals("zstandard9", options.jdbcAvroOptions().avroCodec()); - Assert.assertEquals( + Assertions.assertEquals("zstandard9", options.jdbcAvroOptions().avroCodec()); + Assertions.assertEquals( CodecFactory.zstandardCodec(9).toString(), options.jdbcAvroOptions().getCodecFactory().toString()); } @@ -310,8 +337,8 @@ public void shouldConfigureSnappyCodec() throws IOException, ClassNotFoundExcept "--connectionUrl=jdbc:postgresql://some_db --table=some_table " + "--password=secret --avroCodec=snappy"); - Assert.assertEquals("snappy", options.jdbcAvroOptions().avroCodec()); - Assert.assertEquals( + Assertions.assertEquals("snappy", options.jdbcAvroOptions().avroCodec()); + Assertions.assertEquals( CodecFactory.snappyCodec().toString(), options.jdbcAvroOptions().getCodecFactory().toString()); } @@ -328,44 +355,58 @@ public void shouldConfiguraPreCommands() throws IOException, ClassNotFoundExcept "--preCommand=set bar=2" }); - Assert.assertEquals("set foo='1'", options.jdbcAvroOptions().preCommand().get(0)); - Assert.assertEquals("set bar=2", options.jdbcAvroOptions().preCommand().get(1)); + Assertions.assertEquals("set foo='1'", options.jdbcAvroOptions().preCommand().get(0)); + Assertions.assertEquals("set bar=2", options.jdbcAvroOptions().preCommand().get(1)); } - @Test(expected = IllegalArgumentException.class) - public void shouldFailOnInvalidAvroCodec() throws IOException, ClassNotFoundException { - optionsFromArgs( - "--connectionUrl=jdbc:postgresql://some_db --table=some_table " - + "--password=secret --avroCodec=lzma"); + @Test + public void shouldFailOnInvalidAvroCodec() { + Assertions.assertThrows( + IllegalArgumentException.class, + () -> + optionsFromArgs( + "--connectionUrl=jdbc:postgresql://some_db --table=some_table " + + "--password=secret --avroCodec=lzma")); } - @Test(expected = IllegalArgumentException.class) - public void shouldFailOnQueryParallelismWithNoSplitColumn() - throws IOException, ClassNotFoundException { - optionsFromArgs( - "--connectionUrl=jdbc:postgresql://some_db " - + "--table=some_table --password=secret --queryParallelism=10"); + @Test + public void shouldFailOnQueryParallelismWithNoSplitColumn() { + Assertions.assertThrows( + IllegalArgumentException.class, + () -> + optionsFromArgs( + "--connectionUrl=jdbc:postgresql://some_db " + + "--table=some_table --password=secret --queryParallelism=10")); } - @Test(expected = IllegalArgumentException.class) - public void shouldFailOnSplitColumnWithNoQueryParallelism() - throws IOException, ClassNotFoundException { - optionsFromArgs( - "--connectionUrl=jdbc:postgresql://some_db " - + "--table=some_table --password=secret --splitColumn=id"); + @Test + public void shouldFailOnSplitColumnWithNoQueryParallelism() { + Assertions.assertThrows( + IllegalArgumentException.class, + () -> + optionsFromArgs( + "--connectionUrl=jdbc:postgresql://some_db " + + "--table=some_table --password=secret --splitColumn=id")); } - @Test(expected = IllegalArgumentException.class) - public void shouldFailOnZeroQueryParallelism() throws IOException, ClassNotFoundException { - optionsFromArgs( - "--connectionUrl=jdbc:postgresql://some_db " - + "--table=some_table --password=secret --queryParallelism=0 --splitColumn=id"); + @Test + public void shouldFailOnZeroQueryParallelism() { + Assertions.assertThrows( + IllegalArgumentException.class, + () -> + optionsFromArgs( + "--connectionUrl=jdbc:postgresql://some_db " + + "--table=some_table --password=secret" + + " --queryParallelism=0 --splitColumn=id")); } - @Test(expected = IllegalArgumentException.class) - public void shouldFailOnNegativeQueryParallelism() throws IOException, ClassNotFoundException { - optionsFromArgs( - "--connectionUrl=jdbc:postgresql://some_db --table=some_table " - + "--password=secret --queryParallelism=-5 --splitColumn=id"); + @Test + public void shouldFailOnNegativeQueryParallelism() { + Assertions.assertThrows( + IllegalArgumentException.class, + () -> + optionsFromArgs( + "--connectionUrl=jdbc:postgresql://some_db --table=some_table " + + "--password=secret --queryParallelism=-5 --splitColumn=id")); } } diff --git a/dbeam-core/src/test/java/com/spotify/dbeam/args/ParallelQueryBuilderTest.java b/dbeam-core/src/test/java/com/spotify/dbeam/args/ParallelQueryBuilderTest.java index e21d8423..b8ce49af 100644 --- a/dbeam-core/src/test/java/com/spotify/dbeam/args/ParallelQueryBuilderTest.java +++ b/dbeam-core/src/test/java/com/spotify/dbeam/args/ParallelQueryBuilderTest.java @@ -26,8 +26,8 @@ import com.google.common.collect.Lists; import java.util.List; import org.hamcrest.Matchers; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; public class ParallelQueryBuilderTest { @@ -91,7 +91,7 @@ public void shouldBuildSingleQueryWhenParallelismIsOne() { Matchers.is(Lists.newArrayList(format("%s AND sp >= %s AND sp <= %s", QUERY_BASE, 1, 10)))); } - @Ignore // TODO: fix this + @Disabled("TODO: fix this") @Test public void shouldBuildMultipleQueriesWhenQueryingFromTwoRows() { final List actual = ParallelQueryBuilder.queriesForBounds(1, 2, 2, "sp", QUERY_FORMAT); diff --git a/dbeam-core/src/test/java/com/spotify/dbeam/args/QueryBuilderArgsTest.java b/dbeam-core/src/test/java/com/spotify/dbeam/args/QueryBuilderArgsTest.java index 0012770a..06470246 100644 --- a/dbeam-core/src/test/java/com/spotify/dbeam/args/QueryBuilderArgsTest.java +++ b/dbeam-core/src/test/java/com/spotify/dbeam/args/QueryBuilderArgsTest.java @@ -34,10 +34,10 @@ import java.time.Instant; import java.util.Optional; import org.apache.beam.sdk.options.PipelineOptionsFactory; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; public class QueryBuilderArgsTest { @@ -46,7 +46,7 @@ public class QueryBuilderArgsTest { private static Connection connection; private static Path coffeesSqlQueryPath; - @BeforeClass + @BeforeAll public static void beforeAll() throws SQLException, ClassNotFoundException, IOException { coffeesSqlQueryPath = TestHelper.createTmpDirPath("jdbc-export-args-test").resolve("coffees_query_1.sql"); @@ -57,19 +57,20 @@ public static void beforeAll() throws SQLException, ClassNotFoundException, IOEx DbTestHelper.createFixtures(CONNECTION_URL); } - @AfterClass + @AfterAll public static void afterAll() throws SQLException { connection.close(); } - @Test(expected = IllegalArgumentException.class) + @Test public void shouldFailOnNullTableName() { - QueryBuilderArgs.create(null); + Assertions.assertThrows(IllegalArgumentException.class, () -> QueryBuilderArgs.create(null)); } - @Test(expected = IllegalArgumentException.class) + @Test public void shouldFailOnInvalidTableName() { - QueryBuilderArgs.create("*invalid#name@!"); + Assertions.assertThrows( + IllegalArgumentException.class, () -> QueryBuilderArgs.create("*invalid#name@!")); } public void shouldNotFailOnTableNameWithDots() { @@ -80,7 +81,7 @@ public void shouldNotFailOnTableNameWithDots() { public void shouldCreateValidSqlQueryFromUserQuery() throws SQLException { final QueryBuilderArgs args = QueryBuilderArgs.createFromQuery("SELECT * FROM some_table"); - Assert.assertEquals( + Assertions.assertEquals( Lists.newArrayList("SELECT * FROM (SELECT * FROM some_table) as user_sql_query WHERE 1=1"), args.buildQueries(null)); } @@ -90,7 +91,7 @@ public void shouldConfigureLimit() throws IOException, SQLException { final QueryBuilderArgs actual = parseOptions("--connectionUrl=jdbc:postgresql://some_db --table=some_table " + "--limit=7"); - Assert.assertEquals( + Assertions.assertEquals( Lists.newArrayList("SELECT * FROM some_table WHERE 1=1 LIMIT 7"), actual.buildQueries(null)); } @@ -102,8 +103,8 @@ public void shouldConfigurePartition() throws IOException, SQLException { "--connectionUrl=jdbc:postgresql://some_db --table=some_table " + "--partition=2027-07-31"); - Assert.assertEquals(Optional.of(Instant.parse("2027-07-31T00:00:00Z")), actual.partition()); - Assert.assertEquals( + Assertions.assertEquals(Optional.of(Instant.parse("2027-07-31T00:00:00Z")), actual.partition()); + Assertions.assertEquals( Lists.newArrayList("SELECT * FROM some_table WHERE 1=1"), actual.buildQueries(null)); } @@ -114,7 +115,7 @@ public void shouldConfigurePartitionForFullIsoString() throws IOException, SQLEx "--connectionUrl=jdbc:postgresql://some_db --table=some_table " + "--partition=2027-07-31T13:37:59Z"); - Assert.assertEquals(Optional.of(Instant.parse("2027-07-31T13:37:59Z")), actual.partition()); + Assertions.assertEquals(Optional.of(Instant.parse("2027-07-31T13:37:59Z")), actual.partition()); } @Test @@ -124,7 +125,7 @@ public void shouldConfigurePartitionForMonthlySchedule() throws IOException, SQL "--connectionUrl=jdbc:postgresql://some_db --table=some_table " + "--partition=2027-05"); - Assert.assertEquals(Optional.of(Instant.parse("2027-05-01T00:00:00Z")), actual.partition()); + Assertions.assertEquals(Optional.of(Instant.parse("2027-05-01T00:00:00Z")), actual.partition()); } @Test @@ -134,7 +135,7 @@ public void shouldConfigurePartitionForHourlySchedule() throws IOException, SQLE "--connectionUrl=jdbc:postgresql://some_db --table=some_table " + "--partition=2027-05-02T23"); - Assert.assertEquals(Optional.of(Instant.parse("2027-05-02T23:00:00Z")), actual.partition()); + Assertions.assertEquals(Optional.of(Instant.parse("2027-05-02T23:00:00Z")), actual.partition()); } @Test @@ -144,7 +145,7 @@ public void shouldConfigurePartitionColumn() throws IOException, SQLException { "--connectionUrl=jdbc:postgresql://some_db --table=some_table " + "--partition=2027-07-31 --partitionColumn=col"); - Assert.assertEquals( + Assertions.assertEquals( Lists.newArrayList( "SELECT * FROM some_table WHERE 1=1 " + "AND col >= '2027-07-31' AND col < '2027-08-01'"), @@ -158,7 +159,7 @@ public void shouldConfigurePartitionColumnAndLimit() throws IOException, SQLExce "--connectionUrl=jdbc:postgresql://some_db --table=some_table " + "--partition=2027-07-31 --partitionColumn=col --limit=5"); - Assert.assertEquals( + Assertions.assertEquals( Lists.newArrayList( "SELECT * FROM some_table WHERE 1=1 " + "AND col >= '2027-07-31' AND col < '2027-08-01' LIMIT 5"), @@ -172,7 +173,7 @@ public void shouldConfigurePartitionColumnAndPartitionPeriod() throws IOExceptio "--connectionUrl=jdbc:postgresql://some_db --table=some_table " + "--partition=2027-07-31 --partitionColumn=col --partitionPeriod=P1M"); - Assert.assertEquals( + Assertions.assertEquals( Lists.newArrayList( "SELECT * FROM some_table WHERE 1=1 " + "AND col >= '2027-07-31' AND col < '2027-08-31'"), @@ -187,7 +188,7 @@ public void shouldConfigurePartitionColumnAndPartitionPeriodForHourly() "--connectionUrl=jdbc:postgresql://some_db --table=some_table " + "--partition=2027-07-31T00 --partitionColumn=col --partitionPeriod=PT1H"); - Assert.assertEquals( + Assertions.assertEquals( Lists.newArrayList( "SELECT * FROM some_table WHERE 1=1 " + "AND col >= '2027-07-31T00:00:00Z' AND col < '2027-07-31T01:00:00Z'"), @@ -204,7 +205,7 @@ public void shouldConfigureLimitForSqlFile() throws IOException, SQLException { "--connectionUrl=jdbc:postgresql://some_db " + "--sqlFile=%s --limit=7", coffeesSqlQueryPath.toString())); - Assert.assertEquals( + Assertions.assertEquals( Lists.newArrayList( "SELECT * FROM (SELECT * FROM COFFEES WHERE SIZE > 10) as user_sql_query" + " WHERE 1=1 LIMIT 7"), @@ -220,7 +221,7 @@ public void shouldConfigurePartitionColumnAndLimitForSqlFile() throws IOExceptio + "--sqlFile=%s --partition=2027-07-31 --partitionColumn=col --limit=7", coffeesSqlQueryPath.toString())); - Assert.assertEquals( + Assertions.assertEquals( Lists.newArrayList( "SELECT * FROM (SELECT * FROM COFFEES WHERE SIZE > 10) as user_sql_query WHERE 1=1 " + "AND col >= '2027-07-31' AND col < '2027-08-01' LIMIT 7"), @@ -238,7 +239,7 @@ public void shouldConfigurePartitionColumnAndPartitionPeriodForSqlFile() + "--partitionColumn=col --partitionPeriod=P1M", coffeesSqlQueryPath.toString())); - Assert.assertEquals( + Assertions.assertEquals( Lists.newArrayList( "SELECT * FROM (SELECT * FROM COFFEES WHERE SIZE > 10) as user_sql_query WHERE 1=1 " + "AND col >= '2027-07-31' AND col < '2027-08-31'"), @@ -253,7 +254,7 @@ public void shouldCreateParallelQueries() throws IOException, SQLException { "--connectionUrl=jdbc:postgresql://some_db --table=COFFEES " + "--splitColumn=ROWNUM --queryParallelism=5"); - Assert.assertEquals( + Assertions.assertEquals( Lists.newArrayList("SELECT * FROM COFFEES WHERE 1=1" + " AND ROWNUM >= 1 AND ROWNUM <= 2"), actual.buildQueries(connection)); } @@ -267,7 +268,7 @@ public void shouldCreateParallelQueriesWithSqlFile() throws IOException, SQLExce + "--sqlFile=%s --splitColumn=ROWNUM --queryParallelism=5", coffeesSqlQueryPath.toString())); - Assert.assertEquals( + Assertions.assertEquals( Lists.newArrayList( "SELECT * FROM (SELECT * FROM COFFEES WHERE SIZE > 10) as user_sql_query WHERE 1=1" + " AND ROWNUM >= 1 AND ROWNUM <= 2"), @@ -284,7 +285,7 @@ public void shouldCreateParallelQueriesWithPartitionColumn() throws IOException, + "--partitionColumn=col --partitionPeriod=P1M --limit=7", coffeesSqlQueryPath.toString())); - Assert.assertEquals( + Assertions.assertEquals( Lists.newArrayList( "SELECT * FROM (SELECT * FROM COFFEES WHERE SIZE > 10) as user_sql_query WHERE 1=1" + " AND col >= '2027-07-31' AND col < '2027-08-31' LIMIT 7"), diff --git a/dbeam-core/src/test/java/com/spotify/dbeam/args/QueryBuilderTest.java b/dbeam-core/src/test/java/com/spotify/dbeam/args/QueryBuilderTest.java index 5abf0687..e82e88ba 100644 --- a/dbeam-core/src/test/java/com/spotify/dbeam/args/QueryBuilderTest.java +++ b/dbeam-core/src/test/java/com/spotify/dbeam/args/QueryBuilderTest.java @@ -22,8 +22,8 @@ import java.util.Arrays; import java.util.List; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; public class QueryBuilderTest { @@ -33,7 +33,7 @@ public void testCtorFromTable() { final String expected = "SELECT * FROM abc WHERE 1=1"; - Assert.assertEquals(expected, wrapper.build()); + Assertions.assertEquals(expected, wrapper.build()); } @Test @@ -42,7 +42,7 @@ public void testCtorRawSqlWithoutWhere() { final String expected = "SELECT * FROM (SELECT * FROM t1) as user_sql_query WHERE 1=1"; - Assert.assertEquals(expected, wrapper.build()); + Assertions.assertEquals(expected, wrapper.build()); } @Test @@ -50,7 +50,7 @@ public void testCtorCopyWithConditionNotEquals() { final QueryBuilder q1 = QueryBuilder.fromSqlQuery("SELECT * FROM t1"); final QueryBuilder copy = q1.withPartitionCondition("pary", "20180101", "20180201"); - Assert.assertNotEquals(q1.build(), copy.build()); + Assertions.assertNotEquals(q1.build(), copy.build()); } @Test @@ -58,7 +58,7 @@ public void testCtorCopyWithLimitNotEquals() { final QueryBuilder q1 = QueryBuilder.fromSqlQuery("SELECT * FROM t1"); final QueryBuilder copy = q1.withLimit(3L); - Assert.assertNotEquals(q1.build(), copy.build()); + Assertions.assertNotEquals(q1.build(), copy.build()); } @Test @@ -68,7 +68,7 @@ public void testCtorRawSqlWithWhere() { final String expected = "SELECT * FROM (SELECT * FROM t1 WHERE a > 100) as user_sql_query WHERE 1=1"; - Assert.assertEquals(expected, wrapper.build()); + Assertions.assertEquals(expected, wrapper.build()); } @Test @@ -78,7 +78,7 @@ public void testRawSqlWithLimit() { final String expected = "SELECT * FROM (SELECT * FROM t1) as user_sql_query WHERE 1=1 LIMIT 102"; - Assert.assertEquals(expected, wrapper.build()); + Assertions.assertEquals(expected, wrapper.build()); } @Test @@ -91,7 +91,7 @@ public void testRawSqlwithParallelization() { "SELECT * FROM (SELECT * FROM t1) as user_sql_query" + " WHERE 1=1 AND bucket >= 10 AND bucket < 20"; - Assert.assertEquals(expected, wrapper.build()); + Assertions.assertEquals(expected, wrapper.build()); } @Test @@ -104,7 +104,7 @@ public void testRawSqlWithPartition() { "SELECT * FROM (SELECT * FROM t1) as user_sql_query WHERE 1=1" + " AND birthDate >= '2018-01-01' AND birthDate < '2018-02-01'"; - Assert.assertEquals(expected, wrapper.build()); + Assertions.assertEquals(expected, wrapper.build()); } @Test @@ -117,7 +117,7 @@ public void testRawSqlMultiline() { "SELECT * FROM (SELECT a, b, c FROM t1\n WHERE total > 100\n AND country = 262\n)" + " as user_sql_query WHERE 1=1"; - Assert.assertEquals(expected, wrapper.build()); + Assertions.assertEquals(expected, wrapper.build()); } @Test @@ -131,7 +131,7 @@ public void testRawSqlWithComments() { + "-- We perform initial query here\nSELECT a, b, c FROM t1\n WHERE total > 100)" + " as user_sql_query WHERE 1=1"; - Assert.assertEquals(expected, wrapper.build()); + Assertions.assertEquals(expected, wrapper.build()); } @Test @@ -161,7 +161,7 @@ public void testRawSqlWithCte() { + "GROUP BY date\n" + ") as user_sql_query WHERE 1=1"; - Assert.assertEquals(expected, wrapper.build()); + Assertions.assertEquals(expected, wrapper.build()); } @Test @@ -207,12 +207,12 @@ public void testItGeneratesQueryForLimits() { .withPartitionCondition("partition", "a", "d") .generateQueryToGetLimitsOfSplitColumn("splitCol", "mixy", "maxy") .build(); - Assert.assertEquals(expected, actual); + Assertions.assertEquals(expected, actual); } private void execAndCompare(String rawInput, String expected) { final String actual = QueryBuilder.fromSqlQuery(rawInput).build(); - Assert.assertEquals(expected, actual); + Assertions.assertEquals(expected, actual); } } diff --git a/dbeam-core/src/test/java/com/spotify/dbeam/avro/JdbcAvroRecordTest.java b/dbeam-core/src/test/java/com/spotify/dbeam/avro/JdbcAvroRecordTest.java index f9906186..d8b7d35d 100644 --- a/dbeam-core/src/test/java/com/spotify/dbeam/avro/JdbcAvroRecordTest.java +++ b/dbeam-core/src/test/java/com/spotify/dbeam/avro/JdbcAvroRecordTest.java @@ -57,9 +57,9 @@ import org.apache.avro.io.Decoder; import org.apache.avro.io.DecoderFactory; import org.apache.avro.util.Utf8; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; import org.mockito.Mockito; import org.postgresql.jdbc.PgArray; @@ -68,7 +68,7 @@ public class JdbcAvroRecordTest { private static String CONNECTION_URL = "jdbc:h2:mem:test;MODE=PostgreSQL;DATABASE_TO_UPPER=false;DB_CLOSE_DELAY=-1"; - @BeforeClass + @BeforeAll public static void beforeAll() throws SQLException, ClassNotFoundException { DbTestHelper.createFixtures(CONNECTION_URL); } @@ -85,14 +85,14 @@ public void shouldCreateSchema() throws ClassNotFoundException, SQLException { "Generate schema from JDBC ResultSet from COFFEES jdbc:h2:mem:test", false, ArrayHandlingMode.TypedMetaFromFirstRow, false); - Assert.assertNotNull(actual); - Assert.assertEquals("dbeam_generated", actual.getNamespace()); - Assert.assertEquals("COFFEES", actual.getProp("tableName")); - Assert.assertEquals("jdbc:h2:mem:test", actual.getProp("connectionUrl")); - Assert.assertEquals( + Assertions.assertNotNull(actual); + Assertions.assertEquals("dbeam_generated", actual.getNamespace()); + Assertions.assertEquals("COFFEES", actual.getProp("tableName")); + Assertions.assertEquals("jdbc:h2:mem:test", actual.getProp("connectionUrl")); + Assertions.assertEquals( "Generate schema from JDBC ResultSet from COFFEES jdbc:h2:mem:test", actual.getDoc()); - Assert.assertEquals(fieldCount, actual.getFields().size()); - Assert.assertEquals( + Assertions.assertEquals(fieldCount, actual.getFields().size()); + Assertions.assertEquals( Lists.newArrayList( "COF_NAME", "SUP_ID", @@ -110,45 +110,46 @@ public void shouldCreateSchema() throws ClassNotFoundException, SQLException { "TEXT_ARR"), actual.getFields().stream().map(Schema.Field::name).collect(Collectors.toList())); for (Schema.Field f : actual.getFields()) { - Assert.assertEquals(Schema.Type.UNION, f.schema().getType()); - Assert.assertEquals(2, f.schema().getTypes().size()); - Assert.assertEquals(Schema.Type.NULL, f.schema().getTypes().get(0).getType()); + Assertions.assertEquals(Schema.Type.UNION, f.schema().getType()); + Assertions.assertEquals(2, f.schema().getTypes().size()); + Assertions.assertEquals(Schema.Type.NULL, f.schema().getTypes().get(0).getType()); } - Assert.assertEquals( + Assertions.assertEquals( Schema.Type.STRING, actual.getField("COF_NAME").schema().getTypes().get(1).getType()); - Assert.assertEquals( + Assertions.assertEquals( Schema.Type.INT, actual.getField("SUP_ID").schema().getTypes().get(1).getType()); - Assert.assertEquals( + Assertions.assertEquals( Schema.Type.STRING, actual.getField("PRICE").schema().getTypes().get(1).getType()); - Assert.assertEquals( + Assertions.assertEquals( Schema.Type.FLOAT, actual.getField("TEMPERATURE").schema().getTypes().get(1).getType()); - Assert.assertEquals( + Assertions.assertEquals( Schema.Type.DOUBLE, actual.getField("SIZE").schema().getTypes().get(1).getType()); - Assert.assertEquals( + Assertions.assertEquals( Schema.Type.BOOLEAN, actual.getField("IS_ARABIC").schema().getTypes().get(1).getType()); - Assert.assertEquals( + Assertions.assertEquals( Schema.Type.INT, actual.getField("SALES").schema().getTypes().get(1).getType()); - Assert.assertEquals( + Assertions.assertEquals( Schema.Type.LONG, actual.getField("TOTAL").schema().getTypes().get(1).getType()); - Assert.assertEquals( + Assertions.assertEquals( Schema.Type.LONG, actual.getField("CREATED").schema().getTypes().get(1).getType()); - Assert.assertEquals( + Assertions.assertEquals( Schema.Type.LONG, actual.getField("UPDATED").schema().getTypes().get(1).getType()); - Assert.assertEquals( + Assertions.assertEquals( Schema.Type.BYTES, actual.getField("UID").schema().getTypes().get(1).getType()); - Assert.assertEquals( + Assertions.assertEquals( Schema.Type.LONG, actual.getField("ROWNUM").schema().getTypes().get(1).getType()); - Assert.assertEquals( + Assertions.assertEquals( Schema.Type.ARRAY, actual.getField("INT_ARR").schema().getTypes().get(1).getType()); - Assert.assertEquals( + Assertions.assertEquals( Schema.Type.INT, actual.getField("INT_ARR").schema().getTypes().get(1).getElementType().getType()); - Assert.assertEquals( + Assertions.assertEquals( Schema.Type.ARRAY, actual.getField("TEXT_ARR").schema().getTypes().get(1).getType()); - Assert.assertEquals( + Assertions.assertEquals( Schema.Type.STRING, actual.getField("TEXT_ARR").schema().getTypes().get(1).getElementType().getType()); - Assert.assertNull(actual.getField("UPDATED").schema().getTypes().get(1).getProp("logicalType")); + Assertions.assertNull( + actual.getField("UPDATED").schema().getTypes().get(1).getProp("logicalType")); } @Test @@ -163,8 +164,8 @@ public void shouldCreateSchemaWithLogicalTypes() throws ClassNotFoundException, "Generate schema from JDBC ResultSet from COFFEES jdbc:h2:mem:test", true, ArrayHandlingMode.TypedMetaFromFirstRow, false); - Assert.assertEquals(fieldCount, actual.getFields().size()); - Assert.assertEquals( + Assertions.assertEquals(fieldCount, actual.getFields().size()); + Assertions.assertEquals( "timestamp-millis", actual.getField("UPDATED").schema().getTypes().get(1).getProp("logicalType")); } @@ -180,7 +181,7 @@ public void shouldCreateSchemaWithCustomSchemaName() throws ClassNotFoundExcepti "Generate schema from JDBC ResultSet from COFFEES jdbc:h2:mem:test", false, ArrayHandlingMode.TypedMetaFromFirstRow, false); - Assert.assertEquals("CustomSchemaName", actual.getName()); + Assertions.assertEquals("CustomSchemaName", actual.getName()); } @Test @@ -217,15 +218,15 @@ public void shouldEncodeResultSetToValidAvro() final List records = StreamSupport.stream(dataFileReader.spliterator(), false).collect(Collectors.toList()); - Assert.assertEquals(2, records.size()); + Assertions.assertEquals(2, records.size()); final GenericRecord record = records.stream() .filter(r -> Coffee.COFFEE1.name().equals(r.get(0).toString())) .findFirst() .orElseThrow(() -> new IllegalArgumentException("not found")); - Assert.assertEquals(14, record.getSchema().getFields().size()); - Assert.assertEquals(schema, record.getSchema()); + Assertions.assertEquals(14, record.getSchema().getFields().size()); + Assertions.assertEquals(schema, record.getSchema()); List actualTxtArray = ((GenericData.Array) record.get(13)) .stream().map(x -> x.toString()).collect(Collectors.toList()); @@ -245,7 +246,7 @@ public void shouldEncodeResultSetToValidAvro() (Long) record.get(11), new ArrayList<>((GenericData.Array) record.get(12)), actualTxtArray); - Assert.assertEquals(Coffee.COFFEE1, actual); + Assertions.assertEquals(Coffee.COFFEE1, actual); } @Test @@ -267,7 +268,7 @@ public void shouldCorrectlyEncodeUnsignedIntToAvroLong() throws SQLException { when(resultSet.getLong(columnNum)).thenReturn(valueUnderTest); final Object result = mapping.apply(resultSet); - Assert.assertEquals(Long.class, result.getClass()); - Assert.assertEquals(valueUnderTest, ((Long) result).longValue()); + Assertions.assertEquals(Long.class, result.getClass()); + Assertions.assertEquals(valueUnderTest, ((Long) result).longValue()); } } diff --git a/dbeam-core/src/test/java/com/spotify/dbeam/avro/JdbcAvroSchemaTest.java b/dbeam-core/src/test/java/com/spotify/dbeam/avro/JdbcAvroSchemaTest.java index f981c16f..db01bdcf 100644 --- a/dbeam-core/src/test/java/com/spotify/dbeam/avro/JdbcAvroSchemaTest.java +++ b/dbeam-core/src/test/java/com/spotify/dbeam/avro/JdbcAvroSchemaTest.java @@ -29,8 +29,8 @@ import java.sql.Types; import java.util.Optional; import org.apache.avro.Schema; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; import org.mockito.Mockito; public class JdbcAvroSchemaTest { @@ -43,7 +43,7 @@ public void shouldGetDatabaseTableNameFromMetaData() throws SQLException { when(meta.getColumnCount()).thenReturn(1); when(meta.getTableName(1)).thenReturn("test_table"); - Assert.assertEquals("test_table", JdbcAvroSchema.getDatabaseTableName(meta)); + Assertions.assertEquals("test_table", JdbcAvroSchema.getDatabaseTableName(meta)); } @Test @@ -52,7 +52,7 @@ public void shouldDefaultTableNameWhenMetaDataHasEmptyTableName() throws SQLExce when(meta.getColumnCount()).thenReturn(1); when(meta.getTableName(1)).thenReturn(""); - Assert.assertEquals("no_table_name", JdbcAvroSchema.getDatabaseTableName(meta)); + Assertions.assertEquals("no_table_name", JdbcAvroSchema.getDatabaseTableName(meta)); } @Test @@ -61,7 +61,7 @@ public void shouldDefaultTableNameWhenMetaDataHasNullTableName() throws SQLExcep when(meta.getColumnCount()).thenReturn(1); when(meta.getTableName(1)).thenReturn(null); - Assert.assertEquals("no_table_name", JdbcAvroSchema.getDatabaseTableName(meta)); + Assertions.assertEquals("no_table_name", JdbcAvroSchema.getDatabaseTableName(meta)); } @Test @@ -71,7 +71,7 @@ public void shouldGetDatabaseTableNameFromFirstNonNullMetaData() throws SQLExcep when(meta.getTableName(1)).thenReturn(""); when(meta.getTableName(2)).thenReturn("test_table"); - Assert.assertEquals("test_table", JdbcAvroSchema.getDatabaseTableName(meta)); + Assertions.assertEquals("test_table", JdbcAvroSchema.getDatabaseTableName(meta)); } @Test @@ -80,8 +80,8 @@ public void shouldConvertDateSqlTypeWithAvroLogicalType() throws SQLException { final Schema fieldSchema = createAvroSchemaForSingleField(resultSet, true); - Assert.assertEquals(Schema.Type.LONG, fieldSchema.getType()); - Assert.assertEquals("timestamp-millis", fieldSchema.getProp("logicalType")); + Assertions.assertEquals(Schema.Type.LONG, fieldSchema.getType()); + Assertions.assertEquals("timestamp-millis", fieldSchema.getProp("logicalType")); } @Test @@ -90,8 +90,8 @@ public void shouldConvertDateSqlTypeWithoutAvroLogicalType() throws SQLException final Schema fieldSchema = createAvroSchemaForSingleField(resultSet, false); - Assert.assertEquals(Schema.Type.LONG, fieldSchema.getType()); - Assert.assertNull(fieldSchema.getProp("logicalType")); + Assertions.assertEquals(Schema.Type.LONG, fieldSchema.getType()); + Assertions.assertNull(fieldSchema.getProp("logicalType")); } @Test @@ -100,7 +100,7 @@ public void shouldConvertBigIntSqlTypeToLong() throws SQLException { final Schema fieldSchema = createAvroSchemaForSingleField(resultSet, false); - Assert.assertEquals(Schema.Type.LONG, fieldSchema.getType()); + Assertions.assertEquals(Schema.Type.LONG, fieldSchema.getType()); } @Test @@ -109,7 +109,7 @@ public void shouldConvertBitSqlTypeWithNoPrecisionToBoolean() throws SQLExceptio final Schema fieldSchema = createAvroSchemaForSingleField(resultSet, false); - Assert.assertEquals(Schema.Type.BOOLEAN, fieldSchema.getType()); + Assertions.assertEquals(Schema.Type.BOOLEAN, fieldSchema.getType()); } @Test @@ -119,30 +119,34 @@ public void shouldConvertBitSqlTypeWithPrecision2ToBytes() throws SQLException { final Schema fieldSchema = createAvroSchemaForSingleField(resultSet, false); - Assert.assertEquals(Schema.Type.BYTES, fieldSchema.getType()); + Assertions.assertEquals(Schema.Type.BYTES, fieldSchema.getType()); } @Test public void shouldThrowOnNonSupportedTypes() throws SQLException { final ResultSet resultSet = buildMockResultSet(Types.STRUCT); - RuntimeException thrown = Assert.assertThrows(RuntimeException.class, - () -> createAvroSchemaForSingleField(resultSet, false)); - Assert.assertEquals("STRUCT type is not supported", thrown.getMessage()); + RuntimeException thrown = + Assertions.assertThrows( + RuntimeException.class, () -> createAvroSchemaForSingleField(resultSet, false)); + Assertions.assertEquals("STRUCT type is not supported", thrown.getMessage()); final ResultSet resultSet2 = buildMockResultSet(Types.REF); - RuntimeException thrown2 = Assert.assertThrows(RuntimeException.class, - () -> createAvroSchemaForSingleField(resultSet2, false)); - Assert.assertEquals("REF and REF_CURSOR type are not supported", thrown2.getMessage()); + RuntimeException thrown2 = + Assertions.assertThrows( + RuntimeException.class, () -> createAvroSchemaForSingleField(resultSet2, false)); + Assertions.assertEquals("REF and REF_CURSOR type are not supported", thrown2.getMessage()); final ResultSet resultSet3 = buildMockResultSet(Types.REF_CURSOR); - RuntimeException thrown3 = Assert.assertThrows(RuntimeException.class, - () -> createAvroSchemaForSingleField(resultSet3, false)); - Assert.assertEquals("REF and REF_CURSOR type are not supported", thrown3.getMessage()); + RuntimeException thrown3 = + Assertions.assertThrows( + RuntimeException.class, () -> createAvroSchemaForSingleField(resultSet3, false)); + Assertions.assertEquals("REF and REF_CURSOR type are not supported", thrown3.getMessage()); final ResultSet resultSet4 = buildMockResultSet(Types.DATALINK); - RuntimeException thrown4 = Assert.assertThrows(RuntimeException.class, - () -> createAvroSchemaForSingleField(resultSet4, false)); - Assert.assertEquals("DATALINK type is not supported", thrown4.getMessage()); + RuntimeException thrown4 = + Assertions.assertThrows( + RuntimeException.class, () -> createAvroSchemaForSingleField(resultSet4, false)); + Assertions.assertEquals("DATALINK type is not supported", thrown4.getMessage()); } @Test @@ -152,7 +156,7 @@ public void shouldConvertIntegerWithLongColumnClassNameToLong() throws SQLExcept final Schema fieldSchema = createAvroSchemaForSingleField(resultSet, false); - Assert.assertEquals(Schema.Type.LONG, fieldSchema.getType()); + Assertions.assertEquals(Schema.Type.LONG, fieldSchema.getType()); } @Test @@ -161,7 +165,7 @@ public void shouldConvertIntegerSqlTypeToInteger() throws SQLException { final Schema fieldSchema = createAvroSchemaForSingleField(resultSet, false); - Assert.assertEquals(Schema.Type.INT, fieldSchema.getType()); + Assertions.assertEquals(Schema.Type.INT, fieldSchema.getType()); } @Test @@ -170,7 +174,7 @@ public void shouldDefaultConversionToStringType() throws SQLException { final Schema fieldSchema = createAvroSchemaForSingleField(resultSet, false); - Assert.assertEquals(Schema.Type.STRING, fieldSchema.getType()); + Assertions.assertEquals(Schema.Type.STRING, fieldSchema.getType()); } @Test @@ -178,8 +182,8 @@ public void shouldConvertUuidSqlTypeWithAvroLogicalType() throws SQLException { final ResultSet resultSet = buildMockResultSet(Types.OTHER, "uuid"); final Schema fieldSchema = createAvroSchemaForSingleField(resultSet, true); - Assert.assertEquals(Schema.Type.STRING, fieldSchema.getType()); - Assert.assertEquals("uuid", fieldSchema.getProp("logicalType")); + Assertions.assertEquals(Schema.Type.STRING, fieldSchema.getType()); + Assertions.assertEquals("uuid", fieldSchema.getProp("logicalType")); } @Test @@ -187,8 +191,8 @@ public void shouldConvertUuidSqlTypeWithoutAvroLogicalType() throws SQLException final ResultSet resultSet = buildMockResultSet(Types.OTHER, "uuid"); final Schema fieldSchema = createAvroSchemaForSingleField(resultSet, false); - Assert.assertEquals(Schema.Type.STRING, fieldSchema.getType()); - Assert.assertNull(fieldSchema.getProp("logicalType")); + Assertions.assertEquals(Schema.Type.STRING, fieldSchema.getType()); + Assertions.assertNull(fieldSchema.getProp("logicalType")); } private Schema createAvroSchemaForSingleField( diff --git a/dbeam-core/src/test/java/com/spotify/dbeam/avro/PostgresJdbcAvroTest.java b/dbeam-core/src/test/java/com/spotify/dbeam/avro/PostgresJdbcAvroTest.java index 5f1d8239..5fe482b5 100644 --- a/dbeam-core/src/test/java/com/spotify/dbeam/avro/PostgresJdbcAvroTest.java +++ b/dbeam-core/src/test/java/com/spotify/dbeam/avro/PostgresJdbcAvroTest.java @@ -45,8 +45,8 @@ import org.apache.avro.generic.GenericDatumWriter; import org.apache.avro.generic.GenericRecord; import org.apache.avro.util.Utf8; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; import org.mockito.Mockito; public class PostgresJdbcAvroTest { @@ -88,10 +88,10 @@ public void assertGenericRecordArrayField(GenericRecord record, String fieldName final GenericData.Array arrayValue = (GenericData.Array) record.get(fieldName); - Assert.assertEquals(expectedItems.length, arrayValue.size()); + Assertions.assertEquals(expectedItems.length, arrayValue.size()); for (int i = 0; i < expectedItems.length; i++) { - Assert.assertEquals(expectedItems[i], arrayValue.get(i)); + Assertions.assertEquals(expectedItems[i], arrayValue.get(i)); } } @@ -118,7 +118,7 @@ public void shouldEncodeUUIDValues() throws SQLException, IOException { GenericRecord actualRecord = bytesToGenericRecords(schema, converter.convertResultSetIntoAvroBytes())[0]; - Assert.assertEquals(actualRecord.get("uuid_field"), new Utf8(uuidExpected.toString())); + Assertions.assertEquals(actualRecord.get("uuid_field"), new Utf8(uuidExpected.toString())); assertGenericRecordArrayField(actualRecord, "array_field", new Utf8(uuidExpected.toString())); } @@ -149,10 +149,10 @@ public void shouldEncodeStringAndOtherValues() throws SQLException, IOException final JdbcAvroRecordConverter converter = JdbcAvroRecordConverter.create(resultSet, arrayMode, false); - GenericRecord actualRecord = bytesToGenericRecords(schema, - converter.convertResultSetIntoAvroBytes())[0]; - Assert.assertEquals(actualRecord.get("text_field"), new Utf8("some_text_42")); - Assert.assertEquals(actualRecord.get("other_field"), new Utf8("some_other_42")); + GenericRecord actualRecord = + bytesToGenericRecords(schema, converter.convertResultSetIntoAvroBytes())[0]; + Assertions.assertEquals(actualRecord.get("text_field"), new Utf8("some_text_42")); + Assertions.assertEquals(actualRecord.get("other_field"), new Utf8("some_other_42")); assertGenericRecordArrayField(actualRecord, "array_field1", "some_text_42"); assertGenericRecordArrayField(actualRecord, "array_field2", "some_varchar_42"); assertGenericRecordArrayField(actualRecord, "array_other", "some_other_42"); @@ -168,9 +168,18 @@ public void shouldThrowOnArrayWithNulls() throws SQLException, IOException { when(resultSet.getArray(1)).thenReturn(null); when(resultSet.isFirst()).thenReturn(true); - Assert.assertThrows(RuntimeException.class, () -> JdbcAvroSchema.createAvroSchema(resultSet, - "ns", "conn_url", - Optional.empty(), "doc", true, ArrayHandlingMode.TypedMetaFromFirstRow, false)); + Assertions.assertThrows( + RuntimeException.class, + () -> + JdbcAvroSchema.createAvroSchema( + resultSet, + "ns", + "conn_url", + Optional.empty(), + "doc", + true, + ArrayHandlingMode.TypedMetaFromFirstRow, + false)); } @Test @@ -191,10 +200,10 @@ public void shouldHandleArrayWithNullsUsingArrayAsBytes() throws SQLException, I final JdbcAvroRecordConverter converter = JdbcAvroRecordConverter.create(resultSet, arrayMode, false); - GenericRecord actualRecord = bytesToGenericRecords(schema, - converter.convertResultSetIntoAvroBytes())[0]; - Assert.assertArrayEquals(expectedValue, - ((java.nio.ByteBuffer) actualRecord.get("array_field")).array()); + GenericRecord actualRecord = + bytesToGenericRecords(schema, converter.convertResultSetIntoAvroBytes())[0]; + Assertions.assertArrayEquals( + expectedValue, ((java.nio.ByteBuffer) actualRecord.get("array_field")).array()); } @Test @@ -229,12 +238,12 @@ public void shouldHandleArrayWithNullsWithoutReadingFirstRow() throws SQLExcepti GenericRecord[] actualRecords = bytesToGenericRecords(schema, converter.convertResultSetIntoAvroBytes(), converter.convertResultSetIntoAvroBytes()); - Assert.assertNull(actualRecords[0].get("array_field_varchar")); - Assert.assertNull(actualRecords[0].get("array_field_text")); - Assert.assertNull(actualRecords[0].get("array_field_uuid")); - Assert.assertNull(actualRecords[0].get("array_field_int")); - Assert.assertNull(actualRecords[0].get("array_field_int4")); - Assert.assertNull(actualRecords[0].get("array_field_int8")); + Assertions.assertNull(actualRecords[0].get("array_field_varchar")); + Assertions.assertNull(actualRecords[0].get("array_field_text")); + Assertions.assertNull(actualRecords[0].get("array_field_uuid")); + Assertions.assertNull(actualRecords[0].get("array_field_int")); + Assertions.assertNull(actualRecords[0].get("array_field_int4")); + Assertions.assertNull(actualRecords[0].get("array_field_int8")); assertGenericRecordArrayField(actualRecords[1], "array_field_varchar", "some_varchar_42", "42"); assertGenericRecordArrayField(actualRecords[1], "array_field_text", "some_text_42", "42"); assertGenericRecordArrayField(actualRecords[1], "array_field_uuid", @@ -296,12 +305,14 @@ public void shouldThrowOnArrayWithNullsIfDisabled() throws SQLException { String arrayMode = ArrayHandlingMode.TypedMetaPostgres; boolean nullableArrayItems = false; - final JdbcAvroRecordConverter converter = JdbcAvroRecordConverter.create(resultSet, arrayMode, - nullableArrayItems); - RuntimeException thrown = Assert.assertThrows(RuntimeException.class, - () -> converter.convertResultSetIntoAvroBytes()); - Assert.assertEquals("Array item is null in column 'array_field_varchar', use " - + "--nullableArrayItems", thrown.getMessage()); + final JdbcAvroRecordConverter converter = + JdbcAvroRecordConverter.create(resultSet, arrayMode, nullableArrayItems); + RuntimeException thrown = + Assertions.assertThrows( + RuntimeException.class, () -> converter.convertResultSetIntoAvroBytes()); + Assertions.assertEquals( + "Array item is null in column 'array_field_varchar', use " + "--nullableArrayItems", + thrown.getMessage()); } @Test @@ -318,12 +329,14 @@ public void shouldThrowOnUnknownType() throws SQLException { String arrayMode = ArrayHandlingMode.TypedMetaPostgres; boolean nullableArrayItems = false; - final JdbcAvroRecordConverter converter = JdbcAvroRecordConverter.create(resultSet, arrayMode, - nullableArrayItems); - RuntimeException thrown = Assert.assertThrows(RuntimeException.class, - () -> converter.convertResultSetIntoAvroBytes()); - Assert.assertEquals("Value of type class java.io.File in column 'invalid_array' is not " - + "supported", thrown.getMessage()); + final JdbcAvroRecordConverter converter = + JdbcAvroRecordConverter.create(resultSet, arrayMode, nullableArrayItems); + RuntimeException thrown = + Assertions.assertThrows( + RuntimeException.class, () -> converter.convertResultSetIntoAvroBytes()); + Assertions.assertEquals( + "Value of type class java.io.File in column 'invalid_array' is not " + "supported", + thrown.getMessage()); } @Test @@ -340,10 +353,21 @@ public void shouldThrowOnInvalidArrayColumnTypeName() throws SQLException { String arrayMode = ArrayHandlingMode.TypedMetaPostgres; boolean nullableArrayItems = true; - RuntimeException thrown = Assert.assertThrows(RuntimeException.class, - () -> JdbcAvroSchema.createAvroSchema(resultSet, "ns", "conn_url", - Optional.empty(), "doc", true, arrayMode, nullableArrayItems)); - Assert.assertEquals("columnName=array_field_text columnTypeName=text should start with '_'", + RuntimeException thrown = + Assertions.assertThrows( + RuntimeException.class, + () -> + JdbcAvroSchema.createAvroSchema( + resultSet, + "ns", + "conn_url", + Optional.empty(), + "doc", + true, + arrayMode, + nullableArrayItems)); + Assertions.assertEquals( + "columnName=array_field_text columnTypeName=text should start with '_'", thrown.getMessage()); } @@ -361,10 +385,20 @@ public void shouldThrowOnNotSupportedArrayColumnTypeName() throws SQLException { String arrayMode = ArrayHandlingMode.TypedMetaPostgres; boolean nullableArrayItems = true; - RuntimeException thrown = Assert.assertThrows(RuntimeException.class, - () -> JdbcAvroSchema.createAvroSchema(resultSet, "ns", "conn_url", - Optional.empty(), "doc", true, arrayMode, nullableArrayItems)); - Assert.assertEquals( + RuntimeException thrown = + Assertions.assertThrows( + RuntimeException.class, + () -> + JdbcAvroSchema.createAvroSchema( + resultSet, + "ns", + "conn_url", + Optional.empty(), + "doc", + true, + arrayMode, + nullableArrayItems)); + Assertions.assertEquals( "columnName=array_field_text Postgres type 'not_supported' is not supported", thrown.getMessage()); } diff --git a/dbeam-core/src/test/java/com/spotify/dbeam/beam/BeamHelperTest.java b/dbeam-core/src/test/java/com/spotify/dbeam/beam/BeamHelperTest.java index 1a348f00..892ebada 100644 --- a/dbeam-core/src/test/java/com/spotify/dbeam/beam/BeamHelperTest.java +++ b/dbeam-core/src/test/java/com/spotify/dbeam/beam/BeamHelperTest.java @@ -20,13 +20,13 @@ package com.spotify.dbeam.beam; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; import java.io.IOException; import org.apache.beam.sdk.io.FileSystems; import org.apache.beam.sdk.options.PipelineOptionsFactory; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class BeamHelperTest { @@ -40,9 +40,10 @@ public void shouldWorkWithGcs() throws IOException { } catch (IOException e) { // Beam changed behavior - now throws IOException instead of FileNotFoundException // Verify it's the expected GCS error message - assertTrue("Exception should indicate GCS file matching error", - e.getMessage().contains("Error matching file spec") - && e.getMessage().contains("gs://does-not-exist-1")); + assertTrue( + e.getMessage().contains("Error matching file spec") + && e.getMessage().contains("gs://does-not-exist-1"), + "Exception should indicate GCS file matching error"); } } } diff --git a/dbeam-core/src/test/java/com/spotify/dbeam/jobs/BeamHelperTest.java b/dbeam-core/src/test/java/com/spotify/dbeam/jobs/BeamHelperTest.java index 9c20ffd0..0b5cb392 100644 --- a/dbeam-core/src/test/java/com/spotify/dbeam/jobs/BeamHelperTest.java +++ b/dbeam-core/src/test/java/com/spotify/dbeam/jobs/BeamHelperTest.java @@ -26,8 +26,8 @@ import org.apache.beam.sdk.Pipeline; import org.apache.beam.sdk.PipelineResult; import org.apache.beam.sdk.metrics.MetricResults; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; public class BeamHelperTest { @@ -62,9 +62,9 @@ public MetricResults metrics() { }; try { BeamHelper.waitUntilDone(mockResult, Duration.ofMinutes(1)); - Assert.fail("A PipelineExecutionException should be thrown"); + Assertions.fail("A PipelineExecutionException should be thrown"); } catch (Pipeline.PipelineExecutionException exception) { - Assert.assertEquals( + Assertions.assertEquals( "java.lang.Exception: Job finished with terminalState FAILED", exception.getMessage()); } } @@ -100,9 +100,9 @@ public MetricResults metrics() { }; try { BeamHelper.waitUntilDone(mockResult, Duration.ofMinutes(1)); - Assert.fail("A PipelineExecutionException should be thrown"); + Assertions.fail("A PipelineExecutionException should be thrown"); } catch (Pipeline.PipelineExecutionException exception) { - Assert.assertEquals( + Assertions.assertEquals( "java.lang.Exception: Job cancelled after exceeding timeout PT1M", exception.getMessage()); } @@ -139,9 +139,9 @@ public MetricResults metrics() { }; try { BeamHelper.waitUntilDone(mockResult, Duration.ofMinutes(1)); - Assert.fail("A PipelineExecutionException should be thrown"); + Assertions.fail("A PipelineExecutionException should be thrown"); } catch (Pipeline.PipelineExecutionException exception) { - Assert.assertEquals( + Assertions.assertEquals( "java.lang.Exception: Job cancelled after exceeding timeout PT1M", exception.getMessage()); } @@ -178,9 +178,9 @@ public MetricResults metrics() { }; try { BeamHelper.waitUntilDone(mockResult, Duration.ofMinutes(1)); - Assert.fail("A PipelineExecutionException should be thrown"); + Assertions.fail("A PipelineExecutionException should be thrown"); } catch (Pipeline.PipelineExecutionException exception) { - Assert.assertEquals( + Assertions.assertEquals( "java.lang.Exception: Job exceeded timeout of PT1M, " + "but was not possible to cancel, finished with terminalState RUNNING", exception.getMessage()); diff --git a/dbeam-core/src/test/java/com/spotify/dbeam/jobs/BenchJdbcAvroJobTest.java b/dbeam-core/src/test/java/com/spotify/dbeam/jobs/BenchJdbcAvroJobTest.java index 5ff27485..6354b17d 100644 --- a/dbeam-core/src/test/java/com/spotify/dbeam/jobs/BenchJdbcAvroJobTest.java +++ b/dbeam-core/src/test/java/com/spotify/dbeam/jobs/BenchJdbcAvroJobTest.java @@ -28,8 +28,8 @@ import java.io.IOException; import java.nio.file.Path; import java.sql.SQLException; -import org.junit.BeforeClass; -import org.junit.Test; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; public class BenchJdbcAvroJobTest { @@ -37,7 +37,7 @@ public class BenchJdbcAvroJobTest { "jdbc:h2:mem:test3;MODE=PostgreSQL;DATABASE_TO_UPPER=false;DB_CLOSE_DELAY=-1"; private static Path testDir; - @BeforeClass + @BeforeAll public static void beforeAll() throws SQLException, ClassNotFoundException, IOException { testDir = TestHelper.createTmpDirPath("jdbc-export-args-test"); DbTestHelper.createFixtures(CONNECTION_URL); diff --git a/dbeam-core/src/test/java/com/spotify/dbeam/jobs/JdbcAvroJobTest.java b/dbeam-core/src/test/java/com/spotify/dbeam/jobs/JdbcAvroJobTest.java index 0a8174d8..55dd0806 100644 --- a/dbeam-core/src/test/java/com/spotify/dbeam/jobs/JdbcAvroJobTest.java +++ b/dbeam-core/src/test/java/com/spotify/dbeam/jobs/JdbcAvroJobTest.java @@ -48,9 +48,9 @@ import org.apache.beam.sdk.options.PipelineOptions; import org.apache.beam.sdk.options.PipelineOptionsFactory; import org.hamcrest.CoreMatchers; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; public class JdbcAvroJobTest { @@ -69,7 +69,7 @@ private List readAvroRecords(File avroFile, Schema schema) throws return records; } - @BeforeClass + @BeforeAll public static void beforeAll() throws SQLException, ClassNotFoundException, IOException { testDir = TestHelper.createTmpDirPath("jdbc-avro-test-"); passwordPath = testDir.resolve(".password"); @@ -219,23 +219,26 @@ public void shouldRunAvroJobPreCommands() throws SQLException, ClassNotFoundExce assertThat(schemas, CoreMatchers.hasItems(expectedSchemas)); } - @Test(expected = FailedValidationException.class) - public void shouldFailWithNotEnoughRows() throws Exception { + @Test + public void shouldFailWithNotEnoughRows() { final Path outputPath = testDir.resolve("shouldRunJdbcAvroJob"); - JdbcAvroJob.create( - new String[] { - "--targetParallelism=1", // no need for more threads when testing - "--partition=2025-02-28", - "--skipPartitionCheck", - "--connectionUrl=" + CONNECTION_URL, - "--username=", - "--passwordFile=" + passwordPath.toString(), - "--table=COFFEES", - "--output=" + outputPath, - "--minRows=1000" - }) - .runExport(); + Assertions.assertThrows( + FailedValidationException.class, + () -> + JdbcAvroJob.create( + new String[] { + "--targetParallelism=1", // no need for more threads when testing + "--partition=2025-02-28", + "--skipPartitionCheck", + "--connectionUrl=" + CONNECTION_URL, + "--username=", + "--passwordFile=" + passwordPath.toString(), + "--table=COFFEES", + "--output=" + outputPath, + "--minRows=1000" + }) + .runExport()); } @Test @@ -255,33 +258,38 @@ public void shouldConfigureDBeamVersionPipelineOptions() throws Exception { }); jdbcAvroJob.prepareExport(); - Assert.assertEquals( + Assertions.assertEquals( this.getClass().getPackage().getImplementationVersion(), jdbcAvroJob.getPipelineOptions().as(DBeamPipelineOptions.class).getDBeamVersion()); } @Test public void shouldHaveDefaultExitCode() { - Assert.assertEquals( + Assertions.assertEquals( Integer.valueOf(49), ExceptionHandling.exitCode(new IllegalStateException())); } @Test public void shouldExit50OnFailedValidationException() { - Assert.assertEquals( + Assertions.assertEquals( Integer.valueOf(50), ExceptionHandling.exitCode(new FailedValidationException(""))); } - @Test(expected = IllegalArgumentException.class) - public void shouldFailOnMissingInput() throws IOException, ClassNotFoundException { - JdbcAvroJob.create(PipelineOptionsFactory.create()); + @Test + public void shouldFailOnMissingInput() { + Assertions.assertThrows( + IllegalArgumentException.class, () -> JdbcAvroJob.create(PipelineOptionsFactory.create())); } - @Test(expected = IllegalArgumentException.class) - public void shouldFailOnEmptyInput() throws IOException, ClassNotFoundException { - final PipelineOptions pipelineOptions = PipelineOptionsFactory.create(); - pipelineOptions.as(OutputOptions.class).setOutput(""); - JdbcAvroJob.create(PipelineOptionsFactory.create()); + @Test + public void shouldFailOnEmptyInput() { + Assertions.assertThrows( + IllegalArgumentException.class, + () -> { + final PipelineOptions pipelineOptions = PipelineOptionsFactory.create(); + pipelineOptions.as(OutputOptions.class).setOutput(""); + JdbcAvroJob.create(PipelineOptionsFactory.create()); + }); } @Test diff --git a/dbeam-core/src/test/java/com/spotify/dbeam/jobs/PsqlAvroJobTest.java b/dbeam-core/src/test/java/com/spotify/dbeam/jobs/PsqlAvroJobTest.java index 676c58eb..1ab537f4 100644 --- a/dbeam-core/src/test/java/com/spotify/dbeam/jobs/PsqlAvroJobTest.java +++ b/dbeam-core/src/test/java/com/spotify/dbeam/jobs/PsqlAvroJobTest.java @@ -21,7 +21,7 @@ package com.spotify.dbeam.jobs; import java.io.IOException; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class PsqlAvroJobTest { diff --git a/dbeam-core/src/test/java/com/spotify/dbeam/jobs/PsqlReplicationCheckTest.java b/dbeam-core/src/test/java/com/spotify/dbeam/jobs/PsqlReplicationCheckTest.java index b5491463..8147de98 100644 --- a/dbeam-core/src/test/java/com/spotify/dbeam/jobs/PsqlReplicationCheckTest.java +++ b/dbeam-core/src/test/java/com/spotify/dbeam/jobs/PsqlReplicationCheckTest.java @@ -28,8 +28,8 @@ import java.time.Instant; import java.time.Period; import java.util.Optional; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; public class PsqlReplicationCheckTest { private static String CONNECTION_URL = @@ -48,20 +48,22 @@ private static JdbcExportArgs createArgs(String url, QueryBuilderArgs queryBuild Optional.empty()); } - @Test(expected = IllegalArgumentException.class) + @Test public void shouldFailOnInvalidDriver() throws ClassNotFoundException { final JdbcExportArgs args = createArgs("jdbc:mysql://some_db", QueryBuilderArgs.create("some_table")); - PsqlReplicationCheck.validateOptions(args); + Assertions.assertThrows( + IllegalArgumentException.class, () -> PsqlReplicationCheck.validateOptions(args)); } - @Test(expected = IllegalArgumentException.class) + @Test public void shouldFailOnMissingPartition() throws ClassNotFoundException { final JdbcExportArgs args = createArgs("jdbc:postgresql://some_db", QueryBuilderArgs.create("some_table")); - PsqlReplicationCheck.validateOptions(args); + Assertions.assertThrows( + IllegalArgumentException.class, () -> PsqlReplicationCheck.validateOptions(args)); } @Test @@ -82,7 +84,7 @@ public void shouldBeNotReplicationDelayedWhenReplicatedUntilEndOfPartition() { final Instant lastReplication = Instant.parse("2027-08-01T00:00:00Z"); final Period partitionPeriod = Period.ofDays(1); - Assert.assertFalse( + Assertions.assertFalse( PsqlReplicationCheck.isReplicationDelayed(partition, lastReplication, partitionPeriod)); } @@ -92,7 +94,7 @@ public void shouldBeNotReplicationDelayedWhenReplicatedUntilEndTheNextDay() { final Instant lastReplication = Instant.parse("2027-08-02T00:00:00Z"); final Period partitionPeriod = Period.ofDays(1); - Assert.assertFalse( + Assertions.assertFalse( PsqlReplicationCheck.isReplicationDelayed(partition, lastReplication, partitionPeriod)); } @@ -102,7 +104,7 @@ public void shouldBeReplicationDelayedWhenReplicatedUpToPartitionStart() { final Instant lastReplication = Instant.parse("2027-07-31T00:00:00Z"); final Period partitionPeriod = Period.ofDays(1); - Assert.assertTrue( + Assertions.assertTrue( PsqlReplicationCheck.isReplicationDelayed(partition, lastReplication, partitionPeriod)); } @@ -112,7 +114,7 @@ public void shouldBeReplicationDelayedWhenReplicatedBeforePartitionStart() { final Instant lastReplication = Instant.parse("2027-07-30T22:00:00Z"); final Period partitionPeriod = Period.ofDays(1); - Assert.assertTrue( + Assertions.assertTrue( PsqlReplicationCheck.isReplicationDelayed(partition, lastReplication, partitionPeriod)); } @@ -122,7 +124,7 @@ public void shouldBeReplicationDelayedWhenReplicatedInsidePartition() { final Instant lastReplication = Instant.parse("2027-07-31T23:59:59Z"); final Period partitionPeriod = Period.ofDays(1); - Assert.assertTrue( + Assertions.assertTrue( PsqlReplicationCheck.isReplicationDelayed(partition, lastReplication, partitionPeriod)); } @@ -132,7 +134,7 @@ public void shouldWorkWithMonthlyPartitionPeriod() { final Instant lastReplication = Instant.parse("2027-07-31T23:59:59Z"); final Period partitionPeriod = Period.ofMonths(1); - Assert.assertTrue( + Assertions.assertTrue( PsqlReplicationCheck.isReplicationDelayed(partition, lastReplication, partitionPeriod)); } @@ -142,7 +144,7 @@ public void shouldBeDelayedWithHourlyPartitionPeriod() { final Instant lastReplication = Instant.parse("2027-07-31T00:59:59Z"); final Duration partitionPeriod = Duration.ofHours(1); - Assert.assertTrue( + Assertions.assertTrue( PsqlReplicationCheck.isReplicationDelayed(partition, lastReplication, partitionPeriod)); } @@ -152,11 +154,11 @@ public void shouldBeNotDelayedWithHourlyPartitionPeriod() { final Instant lastReplication = Instant.parse("2027-07-31T00:59:59Z"); final Duration partitionPeriod = Duration.ofHours(1); - Assert.assertTrue( + Assertions.assertTrue( PsqlReplicationCheck.isReplicationDelayed(partition, lastReplication, partitionPeriod)); } - @Test(expected = NotReadyException.class) + @Test public void shouldRunQueryAndReturnReplicationDelayed() throws Exception { final String query = "SELECT parsedatetime('2017-02-01 23.58.57 UTC', 'yyyy-MM-dd HH.mm.ss z', 'en', 'UTC')" @@ -175,9 +177,9 @@ public void shouldRunQueryAndReturnReplicationDelayed() throws Exception { final Instant actual = replicationCheck.queryReplication(); - Assert.assertEquals(expectedLastReplication, actual); - Assert.assertTrue(replicationCheck.isReplicationDelayed()); - replicationCheck.checkReplication(); + Assertions.assertEquals(expectedLastReplication, actual); + Assertions.assertTrue(replicationCheck.isReplicationDelayed()); + Assertions.assertThrows(NotReadyException.class, () -> replicationCheck.checkReplication()); } @Test @@ -199,8 +201,8 @@ public void shouldRunQueryAndReturnReplicationNotDelayed() throws Exception { final Instant actual = replicationCheck.queryReplication(); - Assert.assertEquals(expectedLastReplication, actual); - Assert.assertFalse(replicationCheck.isReplicationDelayed()); + Assertions.assertEquals(expectedLastReplication, actual); + Assertions.assertFalse(replicationCheck.isReplicationDelayed()); replicationCheck.checkReplication(); } } diff --git a/dbeam-core/src/test/java/com/spotify/dbeam/options/ArrayHandlingModeTest.java b/dbeam-core/src/test/java/com/spotify/dbeam/options/ArrayHandlingModeTest.java index f6b37592..47105d3a 100644 --- a/dbeam-core/src/test/java/com/spotify/dbeam/options/ArrayHandlingModeTest.java +++ b/dbeam-core/src/test/java/com/spotify/dbeam/options/ArrayHandlingModeTest.java @@ -20,26 +20,30 @@ package com.spotify.dbeam.options; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; public class ArrayHandlingModeTest { @Test public void validValuesShouldPass() { - Assert.assertEquals(ArrayHandlingMode.Bytes, - ArrayHandlingMode.validateValue(ArrayHandlingMode.Bytes)); - Assert.assertEquals(ArrayHandlingMode.TypedMetaFromFirstRow, + Assertions.assertEquals( + ArrayHandlingMode.Bytes, ArrayHandlingMode.validateValue(ArrayHandlingMode.Bytes)); + Assertions.assertEquals( + ArrayHandlingMode.TypedMetaFromFirstRow, ArrayHandlingMode.validateValue(ArrayHandlingMode.TypedMetaFromFirstRow)); - Assert.assertEquals(ArrayHandlingMode.TypedMetaPostgres, + Assertions.assertEquals( + ArrayHandlingMode.TypedMetaPostgres, ArrayHandlingMode.validateValue(ArrayHandlingMode.TypedMetaPostgres)); } @Test public void invalidValueShouldThrow() { - RuntimeException thrown = Assert.assertThrows(RuntimeException.class, - () -> ArrayHandlingMode.validateValue("invalid")); - Assert.assertEquals("Invalid value 'invalid' for array handling mode. Allowed values: " - + "[bytes, typed_first_row, typed_postgres]", + RuntimeException thrown = + Assertions.assertThrows( + RuntimeException.class, () -> ArrayHandlingMode.validateValue("invalid")); + Assertions.assertEquals( + "Invalid value 'invalid' for array handling mode. Allowed values: " + + "[bytes, typed_first_row, typed_postgres]", thrown.getMessage()); } } diff --git a/dbeam-core/src/test/java/com/spotify/dbeam/options/InputAvroSchemaTest.java b/dbeam-core/src/test/java/com/spotify/dbeam/options/InputAvroSchemaTest.java index 1b03dcc9..8d93bd6e 100644 --- a/dbeam-core/src/test/java/com/spotify/dbeam/options/InputAvroSchemaTest.java +++ b/dbeam-core/src/test/java/com/spotify/dbeam/options/InputAvroSchemaTest.java @@ -37,11 +37,11 @@ import org.apache.avro.Schema; import org.apache.avro.SchemaParseException; import org.apache.beam.sdk.options.PipelineOptionsFactory; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; public class InputAvroSchemaTest { @@ -49,7 +49,7 @@ public class InputAvroSchemaTest { private static Path avroSchemaFilePath; private static String avroSchemaFilePathStr; - @BeforeClass + @BeforeAll public static void beforeAll() throws IOException { final String jsonSchema = "{\n" @@ -104,7 +104,7 @@ private Schema createRecordSchema( return inputSchema; } - @AfterClass + @AfterAll public static void afterAll() throws IOException { Files.delete(avroSchemaFile.toPath()); } @@ -115,17 +115,17 @@ public void checkReadAvroSchema() throws IOException { PipelineOptionsFactory.create().as(JdbcExportPipelineOptions.class); options.setAvroSchemaFilePath(avroSchemaFilePathStr); - Assert.assertEquals(avroSchemaFilePathStr, options.getAvroSchemaFilePath()); + Assertions.assertEquals(avroSchemaFilePathStr, options.getAvroSchemaFilePath()); final Schema inputSchema = BeamJdbcAvroSchema.parseInputAvroSchemaFile(avroSchemaFilePathStr); - Assert.assertEquals("Record description", inputSchema.getDoc()); - Assert.assertEquals("Field1 description", inputSchema.getField("field1").doc()); - Assert.assertEquals("Field2 description", inputSchema.getField("field2").doc()); + Assertions.assertEquals("Record description", inputSchema.getDoc()); + Assertions.assertEquals("Field1 description", inputSchema.getField("field1").doc()); + Assertions.assertEquals("Field2 description", inputSchema.getField("field2").doc()); } @Test - @Ignore + @Disabled public void checkFullPath() { // TODO // Check provide input string to args and verify final schema @@ -146,8 +146,8 @@ public void checkReadAvroSchemaWithEmptyParameter() throws IOException { PipelineOptionsFactory.create().as(JdbcExportPipelineOptions.class); options.setAvroSchemaFilePath(path); - Assert.assertEquals(path, options.getAvroSchemaFilePath()); - Assert.assertEquals( + Assertions.assertEquals(path, options.getAvroSchemaFilePath()); + Assertions.assertEquals( Optional.empty(), BeamJdbcAvroSchema.parseOptionalInputAvroSchemaFile(path)); } @@ -158,12 +158,12 @@ public void checkReadAvroSchemaWithNullParameter() throws IOException { PipelineOptionsFactory.create().as(JdbcExportPipelineOptions.class); options.setAvroSchemaFilePath(path); - Assert.assertEquals(path, options.getAvroSchemaFilePath()); - Assert.assertEquals( + Assertions.assertEquals(path, options.getAvroSchemaFilePath()); + Assertions.assertEquals( Optional.empty(), BeamJdbcAvroSchema.parseOptionalInputAvroSchemaFile(path)); } - @Test(expected = SchemaParseException.class) + @Test public void checkReadAvroSchemaWithInvalidFormat() throws IOException { final String invalidJson = "{"; final File invalidFile = createTestAvroSchemaFile(invalidJson); @@ -172,19 +172,23 @@ public void checkReadAvroSchemaWithInvalidFormat() throws IOException { PipelineOptionsFactory.create().as(JdbcExportPipelineOptions.class); options.setAvroSchemaFilePath(path); - Assert.assertEquals(path, options.getAvroSchemaFilePath()); - BeamJdbcAvroSchema.parseOptionalInputAvroSchemaFile(path); + Assertions.assertEquals(path, options.getAvroSchemaFilePath()); + Assertions.assertThrows( + SchemaParseException.class, + () -> BeamJdbcAvroSchema.parseOptionalInputAvroSchemaFile(path)); } - @Test(expected = FileNotFoundException.class) - public void checkReadAvroSchemaWithNonExistentFile() throws IOException { + @Test + public void checkReadAvroSchemaWithNonExistentFile() { final String path = "non_existent_schema.avsc"; final JdbcExportPipelineOptions options = PipelineOptionsFactory.create().as(JdbcExportPipelineOptions.class); options.setAvroSchemaFilePath(path); - Assert.assertEquals(path, options.getAvroSchemaFilePath()); - BeamJdbcAvroSchema.parseOptionalInputAvroSchemaFile(path); + Assertions.assertEquals(path, options.getAvroSchemaFilePath()); + Assertions.assertThrows( + FileNotFoundException.class, + () -> BeamJdbcAvroSchema.parseOptionalInputAvroSchemaFile(path)); } @Test @@ -194,7 +198,7 @@ public void checkValidCommandLineArgIsParsedAsOptions() throws IOException, SQLE "--connectionUrl=jdbc:postgresql://some_db --table=some_table " + "--avroSchemaFilePath=/temp/record1.avsc --partition=2027-07-31"); - Assert.assertEquals("/temp/record1.avsc", options.getAvroSchemaFilePath()); + Assertions.assertEquals("/temp/record1.avsc", options.getAvroSchemaFilePath()); } @Test @@ -204,7 +208,7 @@ public void checkEmptyCommandLineArgIsParsedAsOptions() throws IOException, SQLE "--connectionUrl=jdbc:postgresql://some_db --table=some_table " + "--partition=2027-07-31"); - Assert.assertNull(options.getAvroSchemaFilePath()); + Assertions.assertNull(options.getAvroSchemaFilePath()); } private QueryBuilderArgs pareOptions(String cmdLineArgs) throws IOException { diff --git a/dbeam-core/src/test/java/com/spotify/dbeam/options/JobNameConfigurationTest.java b/dbeam-core/src/test/java/com/spotify/dbeam/options/JobNameConfigurationTest.java index 983b337e..6995fcb4 100644 --- a/dbeam-core/src/test/java/com/spotify/dbeam/options/JobNameConfigurationTest.java +++ b/dbeam-core/src/test/java/com/spotify/dbeam/options/JobNameConfigurationTest.java @@ -26,8 +26,8 @@ import org.apache.beam.sdk.options.ApplicationNameOptions; import org.apache.beam.sdk.options.PipelineOptions; import org.apache.beam.sdk.options.PipelineOptionsFactory; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; public class JobNameConfigurationTest { @@ -38,7 +38,7 @@ public void shouldConfigureJobName() { JobNameConfiguration.configureJobName(pipelineOptions, "some_db", "some_table"); - Assert.assertEquals( + Assertions.assertEquals( "JdbcAvroJob", pipelineOptions.as(ApplicationNameOptions.class).getAppName()); assertThat(pipelineOptions.getJobName(), startsWith("dbeam-somedb-sometable-")); } @@ -50,7 +50,7 @@ public void shouldConfigureJobNameWhenJobNameIsAuto() { JobNameConfiguration.configureJobName(pipelineOptions, "some_db", "some_table"); - Assert.assertEquals( + Assertions.assertEquals( "JdbcAvroJob", pipelineOptions.as(ApplicationNameOptions.class).getAppName()); assertThat(pipelineOptions.getJobName(), startsWith("dbeam-somedb-sometable-")); } @@ -62,10 +62,10 @@ public void shouldConfigureJobNameWithEmptyTableName() { JobNameConfiguration.configureJobName(pipelineOptions, "some_db", null); - Assert.assertEquals( + Assertions.assertEquals( "JdbcAvroJob", pipelineOptions.as(ApplicationNameOptions.class).getAppName()); assertThat(pipelineOptions.getJobName(), startsWith("dbeam-somedb-")); - Assert.assertEquals(3, pipelineOptions.getJobName().split("-").length); + Assertions.assertEquals(3, pipelineOptions.getJobName().split("-").length); } } diff --git a/dbeam-core/src/test/java/com/spotify/dbeam/options/PasswordReaderTest.java b/dbeam-core/src/test/java/com/spotify/dbeam/options/PasswordReaderTest.java index 25c0475f..17eff000 100644 --- a/dbeam-core/src/test/java/com/spotify/dbeam/options/PasswordReaderTest.java +++ b/dbeam-core/src/test/java/com/spotify/dbeam/options/PasswordReaderTest.java @@ -32,23 +32,23 @@ import java.util.Optional; import org.apache.beam.sdk.extensions.gcp.auth.NoopCredentialFactory; import org.apache.beam.sdk.options.PipelineOptionsFactory; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; public class PasswordReaderTest { private static File passwordFile; - @BeforeClass + @BeforeAll public static void beforeAll() throws IOException { passwordFile = File.createTempFile("pattern", ".suffix"); passwordFile.deleteOnExit(); Files.write(passwordFile.toPath(), "something_encrypted".getBytes(), StandardOpenOption.CREATE); } - @AfterClass + @AfterAll public static void afterAll() throws IOException { Files.delete(passwordFile.toPath()); } @@ -83,6 +83,6 @@ public void shouldDecryptPasswordOnpasswordFileKmsEncryptedParameter() throws IO final Optional actualPassword = passwordReader.readPassword(options); - Assert.assertEquals(Optional.of("something_decrypted"), actualPassword); + Assertions.assertEquals(Optional.of("something_decrypted"), actualPassword); } } From 7971ed1408ccf78df7072f3253391256d1750932 Mon Sep 17 00:00:00 2001 From: Luis Bianchin Date: Fri, 5 Jun 2026 09:59:28 +0200 Subject: [PATCH 30/31] Bump Apache Beam SDK from 2.73.0 to 2.74.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Beam 2.73.0 will be deprecated in April 2027; 2.74.0 (released June 2, 2026) brings security fixes and new features with support until June 2027. Dependency changes: - avro: 1.11.5 → 1.12.0 (Beam's new baseline) - netty: 4.1.124.Final → 4.1.130.Final - jackson: 2.18.2 → 2.18.3 (resolve google-cloud-storage conflict) - google-cloud-libraries-bom: 26.79.0 → 26.80.0 - google-api-client{,-gson}: override to 2.9.0 (resolve bigdataoss conflict with libraries-bom 26.80.0) Fix Avro 1.12.0 test breakage: primitive arrays now use PrimitivesArrays$IntArray instead of GenericData$Array, so casts in tests use List instead. --- .../dbeam/avro/JdbcAvroRecordTest.java | 2 +- .../dbeam/avro/PostgresJdbcAvroTest.java | 3 +-- pom.xml | 25 +++++++++++++------ 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/dbeam-core/src/test/java/com/spotify/dbeam/avro/JdbcAvroRecordTest.java b/dbeam-core/src/test/java/com/spotify/dbeam/avro/JdbcAvroRecordTest.java index d8b7d35d..20c70fe2 100644 --- a/dbeam-core/src/test/java/com/spotify/dbeam/avro/JdbcAvroRecordTest.java +++ b/dbeam-core/src/test/java/com/spotify/dbeam/avro/JdbcAvroRecordTest.java @@ -244,7 +244,7 @@ public void shouldEncodeResultSetToValidAvro() Optional.ofNullable((Long) record.get(9)).map(Timestamp::new), TestHelper.byteBufferToUuid((ByteBuffer) record.get(10)), (Long) record.get(11), - new ArrayList<>((GenericData.Array) record.get(12)), + new ArrayList<>((List) record.get(12)), actualTxtArray); Assertions.assertEquals(Coffee.COFFEE1, actual); } diff --git a/dbeam-core/src/test/java/com/spotify/dbeam/avro/PostgresJdbcAvroTest.java b/dbeam-core/src/test/java/com/spotify/dbeam/avro/PostgresJdbcAvroTest.java index 5fe482b5..52fca268 100644 --- a/dbeam-core/src/test/java/com/spotify/dbeam/avro/PostgresJdbcAvroTest.java +++ b/dbeam-core/src/test/java/com/spotify/dbeam/avro/PostgresJdbcAvroTest.java @@ -86,8 +86,7 @@ public void assertGenericRecordArrayField(GenericRecord record, String fieldName public void assertGenericRecordArrayField(GenericRecord record, String fieldName, Object... expectedItems) { - final GenericData.Array arrayValue = - (GenericData.Array) record.get(fieldName); + final List arrayValue = (List) record.get(fieldName); Assertions.assertEquals(expectedItems.length, arrayValue.size()); for (int i = 0; i < expectedItems.length; i++) { diff --git a/pom.xml b/pom.xml index ff02d27f..730eb04e 100644 --- a/pom.xml +++ b/pom.xml @@ -106,11 +106,11 @@ UTF-8 - - 2.73.0 + + 2.74.0 1.11.0 - 1.11.5 + 1.12.0 3.42.0 1.17.1 1.26.2 @@ -119,17 +119,17 @@ 2.1 4.5.13 4.4.14 - 2.18.2 + 2.18.3 2.14.0 - 4.1.124.Final + 4.1.130.Final 2.0.16 1.6.8 1.5.7-7 - - 26.79.0 + + 26.80.0 0.31.1 @@ -232,6 +232,17 @@ threetenbp ${threetenbp.version} + + + com.google.api-client + google-api-client + 2.9.0 + + + com.google.api-client + google-api-client-gson + 2.9.0 + io.opencensus From 671c5be1253dd6149a60c8958c2a5a85acb5f436 Mon Sep 17 00:00:00 2001 From: Luis Bianchin Date: Fri, 5 Jun 2026 10:08:44 +0200 Subject: [PATCH 31/31] Update dependency and plugin versions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Dependencies: - auto-value: 1.11.0 → 1.11.1 - junit-jupiter: 5.11.4 → 5.14.4 - postgresql: 42.7.8 → 42.7.11 - mockito: 5.20.0 → 5.23.0 - h2: 2.3.232 → 2.4.240 Maven plugins: - maven-compiler-plugin: 3.14.1 → 3.15.0 - maven-release-plugin: 3.1.1 → 3.3.1 - maven-scm: 2.1.0 → 2.2.1 - maven-site-plugin: 3.21.0 → 3.22.0 - maven-jar-plugin: 3.4.2 → 3.5.0 - maven-source-plugin: 3.3.1 → 3.4.0 - maven-project-info-reports-plugin: 3.9.0 → 3.10.0 - maven-surefire-plugin: 3.5.5 → 3.5.6 - maven-enforcer-plugin: 3.6.2 → 3.6.3 - central-publishing-maven-plugin: 0.8.0 → 0.10.0 - jacoco-maven-plugin: 0.8.13 → 0.8.14 --- pom.xml | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/pom.xml b/pom.xml index 730eb04e..cfad7e9b 100644 --- a/pom.xml +++ b/pom.xml @@ -109,7 +109,7 @@ 2.74.0 - 1.11.0 + 1.11.1 1.12.0 3.42.0 1.17.1 @@ -135,10 +135,10 @@ 1.84 - 5.11.4 + 5.14.4 8.4.0 3.5.8 - 42.7.8 + 42.7.11 1.25.0 @@ -432,19 +432,19 @@ org.mockito mockito-core - 5.20.0 + 5.23.0 test org.mockito mockito-junit-jupiter - 5.20.0 + 5.23.0 test com.h2database h2 - 2.3.232 + 2.4.240 test @@ -476,7 +476,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.14.1 + 3.15.0 @@ -499,7 +499,7 @@ maven-release-plugin - 3.1.1 + 3.3.1 v@{project.version} true @@ -512,30 +512,30 @@ org.apache.maven.scm maven-scm-provider-gitexe - 2.1.0 + 2.2.1 org.apache.maven.scm maven-scm-api - 2.1.0 + 2.2.1 maven-site-plugin - 3.21.0 + 3.22.0 org.apache.maven.plugins maven-jar-plugin - 3.4.2 + 3.5.0 org.apache.maven.plugins maven-source-plugin - 3.3.1 + 3.4.0 attach-sources @@ -548,11 +548,11 @@ org.apache.maven.plugins maven-project-info-reports-plugin - 3.9.0 + 3.10.0 maven-surefire-plugin - 3.5.5 + 3.5.6 true @@ -561,7 +561,7 @@ org.apache.maven.plugins maven-enforcer-plugin - 3.6.2 + 3.6.3 enforce @@ -727,7 +727,7 @@ org.sonatype.central central-publishing-maven-plugin - 0.8.0 + 0.10.0 true ossrh @@ -808,7 +808,7 @@ org.jacoco jacoco-maven-plugin - 0.8.13 + 0.8.14