From 11479eb72a73aa83f7b7a0c4b033f14b78023ae1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Nov 2026 02:51:38 +0000 Subject: [PATCH 1/2] Bump org.apache.maven.plugins:maven-surefire-plugin in /lang/java Bumps [org.apache.maven.plugins:maven-surefire-plugin](https://github.com/apache/maven-surefire) from 3.5.6 to 3.6.1. - [Release notes](https://github.com/apache/maven-surefire/releases) - [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.5.6...surefire-3.6.1) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-surefire-plugin dependency-version: 3.6.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 6693fc4cdfd..6d9e8ff13ae 100644 --- a/pom.xml +++ b/pom.xml @@ -63,7 +63,7 @@ 3.3.0 3.5.2 3.11.0 - 3.5.6 + 3.6.1 1723122283 From a2a10c8143358fba1c5c77b14a40b55f0c91f554 Mon Sep 17 00:00:00 2001 From: Fokko Driesprong Date: Mon, 9 Nov 2026 19:54:24 +0000 Subject: [PATCH 2/2] Fix TestSpecificRecordWithUnion under surefire 3.6.x The testNotSerializableClasses assertion relied on SpecificData.get() having an empty class-resolution cache: when another test in the class (or a previously-run test) already resolved TestUnionRecord, the security validator never fired and no SecurityException was thrown. Surefire 3.6.x runs the tests in a different order, exposing this. Use a fresh SpecificData instance for the reader so the class lookup genuinely goes through the security validator. --- .../avro/specific/TestSpecificRecordWithUnion.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lang/java/avro/src/test/java/org/apache/avro/specific/TestSpecificRecordWithUnion.java b/lang/java/avro/src/test/java/org/apache/avro/specific/TestSpecificRecordWithUnion.java index 70f3e7ac90a..b1a1dbe59cb 100644 --- a/lang/java/avro/src/test/java/org/apache/avro/specific/TestSpecificRecordWithUnion.java +++ b/lang/java/avro/src/test/java/org/apache/avro/specific/TestSpecificRecordWithUnion.java @@ -55,10 +55,18 @@ void testNotSerializableClasses() throws IOException { byte[] recordBytes = serializeRecord( "{ \"org.apache.avro.specific.TestUnionRecord\": { \"amount\": { \"bytes\": \"\\u0000\" } } }", schema); + // Use a fresh SpecificData so class resolution is not served from + // SpecificData.get()'s cache (other tests in this class may have resolved + // TestUnionRecord already, and surefire 3.6.x JUnit Platform ordering can + // run them first). The test must exercise the security validator on lookup. + SpecificDatumReader reader = new SpecificDatumReader<>(schema, schema, new SpecificData()); + ClassSecurityPredicate originalValidator = ClassSecurityValidator.getGlobal(); try { ClassSecurityValidator.setGlobal(ClassSecurityValidator.builder().build()); - assertThrows(SecurityException.class, () -> deserializeRecord(schema, recordBytes)); + ByteArrayInputStream in = new ByteArrayInputStream(recordBytes); + Decoder decoder = DecoderFactory.get().binaryDecoder(in, null); + assertThrows(SecurityException.class, () -> reader.read(null, decoder)); } finally { ClassSecurityValidator.setGlobal(originalValidator); }