You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ti...@apache.org on 2026/06/15 03:55:21 UTC

svn commit: r1935324 - pdfbox/branches/3.0/io/src/test/java/org/apache/pdfbox/io

Author: tilman
Date: Mon Jun 15 03:55:21 2026
New Revision: 1935324

Log:
PDFBOX-5660: Sonar fix

Modified:
   pdfbox/branches/3.0/io/src/test/java/org/apache/pdfbox/io/RandomAccessReadViewTest.java

Modified: pdfbox/branches/3.0/io/src/test/java/org/apache/pdfbox/io/RandomAccessReadViewTest.java
==============================================================================
--- pdfbox/branches/3.0/io/src/test/java/org/apache/pdfbox/io/RandomAccessReadViewTest.java	Mon Jun 15 03:55:18 2026	(r1935323)
+++ pdfbox/branches/3.0/io/src/test/java/org/apache/pdfbox/io/RandomAccessReadViewTest.java	Mon Jun 15 03:55:21 2026	(r1935324)
@@ -18,8 +18,8 @@ package org.apache.pdfbox.io;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertThrows;
 import static org.junit.jupiter.api.Assertions.assertTrue;
-import static org.junit.jupiter.api.Assertions.fail;
 
 import java.io.ByteArrayInputStream;
 import java.io.IOException;
@@ -185,12 +185,9 @@ class RandomAccessReadViewTest
              RandomAccessReadView randomAccessReadView =
                 new RandomAccessReadView(randomAccessSource, 10, 20))
         {
-            randomAccessReadView.createView(0, 20);
-            fail("CreateView() should have throw an IOException");
-        }
-        catch (IOException exception)
-        {
-
+            IOException ex =
+                    assertThrows(IOException.class, () -> randomAccessReadView.createView(0, 20));
+            assertEquals("org.apache.pdfbox.io.RandomAccessReadView.createView isn't supported.", ex.getMessage());
         }
     }
 }