Skip to content

Commit 40094b4

Browse files
committed
PDFBOX-5660: Sonar fix
git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1935298 13f79535-47bb-0310-9956-ffa450edef68
1 parent 382a98b commit 40094b4

1 file changed

Lines changed: 3 additions & 8 deletions

File tree

pdfbox/src/test/java/org/apache/pdfbox/pdmodel/font/TestFontEmbedding.java

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
import static org.junit.jupiter.api.Assertions.assertFalse;
5151
import static org.junit.jupiter.api.Assertions.assertNotEquals;
5252
import static org.junit.jupiter.api.Assertions.assertNull;
53+
import static org.junit.jupiter.api.Assertions.assertThrows;
5354
import static org.junit.jupiter.api.Assertions.assertTrue;
5455
import static org.junit.jupiter.api.Assertions.fail;
5556
import org.junit.jupiter.api.BeforeAll;
@@ -827,16 +828,10 @@ void testSurrogatePairCharacterExceptionIsBmpCodePoint() throws IOException
827828
contents.beginText();
828829
contents.setFont(font, 64);
829830
contents.newLineAtOffset(100, 700);
830-
contents.showText(message);
831+
Exception ex = assertThrows(IllegalStateException.class, () -> contents.showText(message));
832+
assertEquals("could not find the glyphId for the character: あ, codePoint: 12354 (0x3042)", ex.getMessage());
831833
contents.endText();
832834
}
833-
catch (IllegalStateException e)
834-
{
835-
assertEquals("could not find the glyphId for the character: あ, codePoint: 12354 (0x3042)", e.getMessage());
836-
return;
837-
}
838-
839-
fail();
840835
}
841836
}
842837

0 commit comments

Comments
 (0)