Skip to content

Commit 754218c

Browse files
committed
PDFBOX-5660: Sonar fix
git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1935303 13f79535-47bb-0310-9956-ffa450edef68
1 parent b1f4460 commit 754218c

1 file changed

Lines changed: 2 additions & 19 deletions

File tree

pdfbox/src/test/java/org/apache/pdfbox/pdmodel/common/function/type4/TestOperators.java

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import static org.junit.jupiter.api.Assertions.assertEquals;
2020
import static org.junit.jupiter.api.Assertions.assertThrows;
2121
import static org.junit.jupiter.api.Assertions.assertTrue;
22-
import static org.junit.jupiter.api.Assertions.fail;
2322

2423
import org.junit.jupiter.api.Test;
2524
import org.junit.jupiter.api.parallel.Execution;
@@ -182,15 +181,7 @@ void testIDiv()
182181
Type4Tester.create("3 2 idiv").pop(1).isEmpty();
183182
Type4Tester.create("4 2 idiv").pop(2).isEmpty();
184183
Type4Tester.create("-5 2 idiv").pop(-2).isEmpty();
185-
try
186-
{
187-
Type4Tester.create("4.4 2 idiv");
188-
fail("Expected typecheck");
189-
}
190-
catch (ClassCastException cce)
191-
{
192-
//expected
193-
}
184+
assertThrows(ClassCastException.class, () -> Type4Tester.create("4.4 2 idiv"), "Expected typecheck");
194185
}
195186

196187
/**
@@ -224,15 +215,7 @@ void testMod()
224215
Type4Tester.create("5 3 mod").pop(2).isEmpty();
225216
Type4Tester.create("5 2 mod").pop(1).isEmpty();
226217
Type4Tester.create("-5 3 mod").pop(-2).isEmpty();
227-
try
228-
{
229-
Type4Tester.create("4.4 2 mod");
230-
fail("Expected typecheck");
231-
}
232-
catch (ClassCastException cce)
233-
{
234-
//expected
235-
}
218+
assertThrows(ClassCastException.class, () -> Type4Tester.create("4.4 2 mod"), "Expected typecheck");
236219
}
237220

238221
/**

0 commit comments

Comments
 (0)