Skip to content

Commit

Permalink
Increase test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
fugerit79 committed Feb 4, 2024
1 parent 182ddf1 commit 5b80f07
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ private static int handleFontStyle( int style, int fontStyle ) {
return style;
}

protected static Font createFont( String fontName, String fontPath, int fontSize, int fontStyle, OpenPdfHelper docHelper, String color ) throws DocumentException, IOException {
public static Font createFont( String fontName, String fontPath, int fontSize, int fontStyle, OpenPdfHelper docHelper, String color ) throws DocumentException, IOException {
Font font = null;
int size = fontSize;
int style = Font.NORMAL;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package test.org.fugerit.java.doc.mod.openpdf.ext;

import java.io.IOException;

import org.fugerit.java.doc.mod.openpdf.ext.helpers.OpenPdfFontHelper;
import org.fugerit.java.doc.mod.openpdf.ext.helpers.OpenPdfHelper;
import org.junit.Assert;
import org.junit.Test;

import com.lowagie.text.DocumentException;
import com.lowagie.text.Font;

public class TestOpenPdfFontHelper {

@Test
public void testCreateFont() throws DocumentException, IOException {
Font font = OpenPdfFontHelper.createFont( "TestTitilliumWeb" , "src/test/resources/font/TitilliumWeb-Regular.ttf", 10, Font.NORMAL, new OpenPdfHelper(), null );
Assert.assertNotNull( font );
}

}

0 comments on commit 5b80f07

Please sign in to comment.