2222import static org .junit .jupiter .api .Assertions .assertNotNull ;
2323import static org .junit .jupiter .api .Assertions .assertThrows ;
2424import static org .junit .jupiter .api .Assertions .assertTrue ;
25- import static org .junit .jupiter .api .Assertions .fail ;
2625
2726import java .io .File ;
2827import java .io .IOException ;
@@ -102,9 +101,11 @@ void createRadioButton()
102101 * Test a radio button with options.
103102 * This was causing an ArrayIndexOutOfBoundsException when trying to set to "Off", as this
104103 * wasn't treated to be a valid option.
104+ *
105+ * @throws IOException
105106 */
106107 @ Test
107- void testRadioButtonWithOptions ()
108+ void testRadioButtonWithOptions () throws IOException
108109 {
109110 File file = new File (TARGET_PDF_DIR , "PDFBOX-3656.pdf" );
110111
@@ -116,10 +117,6 @@ void testRadioButtonWithOptions()
116117 assertEquals (COSName .Off , widget .getCOSObject ().getItem (COSName .AS ),
117118 "The widget should be set to Off" ));
118119 }
119- catch (IOException e )
120- {
121- fail ("Unexpected IOException " + e .getMessage ());
122- }
123120 }
124121
125122 /**
@@ -129,9 +126,10 @@ void testRadioButtonWithOptions()
129126 * Special handling for a radio button with /Opt and the On state not being named
130127 * after the index.
131128 *
129+ * @throws IOException
132130 */
133131 @ Test
134- void testOptionsAndNamesNotNumbers ()
132+ void testOptionsAndNamesNotNumbers () throws IOException
135133 {
136134 File file = new File (TARGET_PDF_DIR , "PDFBOX-3682.pdf" );
137135 try (PDDocument pdfDocument = Loader .loadPDF (file ))
@@ -152,10 +150,6 @@ void testOptionsAndNamesNotNumbers()
152150 radioButton .getWidgets ().get (2 ).getCOSObject ().getNameAsString (COSName .AS ),
153151 "This shall be c" );
154152 }
155- catch (IOException e )
156- {
157- fail ("Unexpected IOException " + e .getMessage ());
158- }
159153 }
160154
161155 @ Test
0 commit comments