]> source.dussan.org Git - poi.git/commitdiff
Don't fail on JDK 21.0.1 if one signature check fails
authorDominik Stadler <centic@apache.org>
Sat, 30 Dec 2023 11:11:21 +0000 (11:11 +0000)
committerDominik Stadler <centic@apache.org>
Sat, 30 Dec 2023 11:11:21 +0000 (11:11 +0000)
See https://bugs.openjdk.org/browse/JDK-8320597 for the
related bug-report for the JDK itself

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1914986 13f79535-47bb-0310-9956-ffa450edef68

poi-ooxml/src/test/java/org/apache/poi/poifs/crypt/dsig/TestSignatureInfo.java

index 3a7e4eb5ed7ee7f33410b5ea92196b2c9b73b0cc..e08c4bce061cb384fa2a90a484d2d631a9bd18f0 100644 (file)
@@ -253,9 +253,15 @@ class TestSignatureInfo {
             si.setSignatureConfig(sic);
             boolean isValid = si.verifySignature();
 
+            // We reported https://bugs.openjdk.org/browse/JDK-8320597 because of this, it will be fixed in JDK 22
+            // and maybe in newer JDK 21 patch-levels
+            assumeTrue(isValid && !"21.0.1".equals(System.getProperty("java.version")),
+                    "This fails on JDK 21.0.1, see https://bugs.openjdk.org/browse/JDK-8320597");
+
             assertTrue(isValid,
                     // add some details to find out why "verifySignature()" returns false sometimes
-                    "Verifying signature failed, hasNext: " + si.getSignatureParts().iterator().hasNext() + ": " +
+                    "Failed for " + System.getProperty("java.version") +
+                            ": Verifying signature failed, hasNext: " + si.getSignatureParts().iterator().hasNext() + ": " +
                             (si.getSignatureParts().iterator().hasNext() ? si.getSignatureParts().iterator() : ""));
         }
     }