From de8ebd74990ce6eb71c089bf583e4fbd8aa22497 Mon Sep 17 00:00:00 2001 From: Denver Persinger Date: Wed, 26 Aug 2026 17:13:37 -0600 Subject: [PATCH 1/3] merge service files --- azure-bundle/build.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/azure-bundle/build.gradle b/azure-bundle/build.gradle index 8d0fe41a5789..0b44f4c5f0e2 100644 --- a/azure-bundle/build.gradle +++ b/azure-bundle/build.gradle @@ -42,6 +42,7 @@ project(":iceberg-azure-bundle") { shadowJar { archiveClassifier.set(null) zip64 true + mergeServiceFiles() // include the LICENSE and NOTICE files for the shaded Jar from(projectDir) { From 563f3f6c25aa9f1ff4cc87ef7d5bb0617e710d30 Mon Sep 17 00:00:00 2001 From: Denver Persinger Date: Fri, 28 Aug 2026 12:05:20 -0600 Subject: [PATCH 2/3] test --- azure-bundle/build.gradle | 7 +++ .../apache/iceberg/azure/TestAzureBundle.java | 52 +++++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 azure-bundle/src/test/java/org/apache/iceberg/azure/TestAzureBundle.java diff --git a/azure-bundle/build.gradle b/azure-bundle/build.gradle index 0b44f4c5f0e2..259eb6747538 100644 --- a/azure-bundle/build.gradle +++ b/azure-bundle/build.gradle @@ -55,6 +55,13 @@ project(":iceberg-azure-bundle") { relocate 'com.fasterxml.jackson', 'org.apache.iceberg.azure.shaded.com.fasterxml.jackson' } + test { + useJUnitPlatform() + dependsOn shadowJar + inputs.file shadowJar.archiveFile + systemProperty 'azure.test.bundle.jar', shadowJar.archiveFile.get().asFile.absolutePath + } + jar { enabled = false } diff --git a/azure-bundle/src/test/java/org/apache/iceberg/azure/TestAzureBundle.java b/azure-bundle/src/test/java/org/apache/iceberg/azure/TestAzureBundle.java new file mode 100644 index 000000000000..210f581a0352 --- /dev/null +++ b/azure-bundle/src/test/java/org/apache/iceberg/azure/TestAzureBundle.java @@ -0,0 +1,52 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.iceberg.azure; + +import static java.nio.charset.StandardCharsets.UTF_8; +import static org.assertj.core.api.Assertions.assertThat; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.util.jar.JarEntry; +import java.util.jar.JarFile; +import org.junit.jupiter.api.Test; + +// this test ensures the azure bundle service registrations contain all entries across all bundled deps +// for ContextAccessor specifically, we expect entries from reactor core and reactor netty +class TestAzureBundle { + + @Test + void shadowJar_containsAllContextAccessorServiceRegistrations() throws IOException { + String bundlePath = System.getProperty("azure.test.bundle.jar"); + assertThat(bundlePath).as("Azure bundle path").isNotNull(); + + try (JarFile bundle = new JarFile(new File(bundlePath))) { + JarEntry serviceDescriptor = bundle.getJarEntry("META-INF/services/io.micrometer.context.ContextAccessor"); + assertThat(serviceDescriptor).as("ContextAccessor service descriptor").isNotNull(); + + try (InputStream input = bundle.getInputStream(serviceDescriptor)) { + assertThat(new String(input.readAllBytes(), UTF_8).split("\\R")) + .contains( + "reactor.netty.contextpropagation.ChannelContextAccessor", + "reactor.util.context.ReactorContextAccessor"); + } + } + } +} From 50d876f830688948da14ed01bda6fcc100afdcc5 Mon Sep 17 00:00:00 2001 From: Denver Persinger Date: Fri, 28 Aug 2026 13:06:19 -0600 Subject: [PATCH 3/3] :broom: --- .../java/org/apache/iceberg/azure/TestAzureBundle.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/azure-bundle/src/test/java/org/apache/iceberg/azure/TestAzureBundle.java b/azure-bundle/src/test/java/org/apache/iceberg/azure/TestAzureBundle.java index 210f581a0352..df47a133e68e 100644 --- a/azure-bundle/src/test/java/org/apache/iceberg/azure/TestAzureBundle.java +++ b/azure-bundle/src/test/java/org/apache/iceberg/azure/TestAzureBundle.java @@ -28,8 +28,8 @@ import java.util.jar.JarFile; import org.junit.jupiter.api.Test; -// this test ensures the azure bundle service registrations contain all entries across all bundled deps -// for ContextAccessor specifically, we expect entries from reactor core and reactor netty +// this test ensures the azure bundle service registrations contain all entries across all bundled +// deps. For ContextAccessor specifically, we expect entries from reactor core and reactor netty class TestAzureBundle { @Test @@ -38,7 +38,8 @@ void shadowJar_containsAllContextAccessorServiceRegistrations() throws IOExcepti assertThat(bundlePath).as("Azure bundle path").isNotNull(); try (JarFile bundle = new JarFile(new File(bundlePath))) { - JarEntry serviceDescriptor = bundle.getJarEntry("META-INF/services/io.micrometer.context.ContextAccessor"); + JarEntry serviceDescriptor = + bundle.getJarEntry("META-INF/services/io.micrometer.context.ContextAccessor"); assertThat(serviceDescriptor).as("ContextAccessor service descriptor").isNotNull(); try (InputStream input = bundle.getInputStream(serviceDescriptor)) {