Skip to content

Commit

Permalink
Update UT
Browse files Browse the repository at this point in the history
  • Loading branch information
Hoang Vu Huy committed Dec 17, 2024
1 parent c6d75ed commit 9ca0cae
Showing 1 changed file with 14 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,9 @@ public void setup() throws Exception {

@Test
public void defaultDoesNotRemoveWhiteSpaceInPdfEditableFields() {

documentTemplate.withDocumentCreationOptions(
DocumentCreationOptions.getInstance()
.withPdfOptions(PdfOptions.getInstance()));
DocumentCreationOptions documentCreationOptions = DocumentCreationOptions.getInstance()
.withPdfOptions(PdfOptions.getInstance().hasToKeepFormFieldsEditable(true));
documentTemplate.withDocumentCreationOptions(documentCreationOptions);

File resultFile = DocFactoryTest.makeFile(
"test/documentTemplate/removingWhiteSpaceInPdfEditableFieldsIT/default_not_remove_fieldSpaces.pdf");
Expand All @@ -46,11 +45,11 @@ public void defaultDoesNotRemoveWhiteSpaceInPdfEditableFields() {
}

@Test
public void removeWhiteSpaceInPdfEditableFields() {
documentTemplate.withDocumentCreationOptions(
DocumentCreationOptions.getInstance()
.withPdfOptions(PdfOptions.getInstance())
.removeWhiteSpaceInPdfEditableFields(true));
public void removeWhiteSpaceInPdfEditableFields() {
DocumentCreationOptions documentCreationOptions = DocumentCreationOptions.getInstance()
.withPdfOptions(PdfOptions.getInstance().hasToKeepFormFieldsEditable(true)
.hasToRemoveWhiteSpaceInPdfEditableFields(true));
documentTemplate.withDocumentCreationOptions(documentCreationOptions);

File resultFile = makeFile(
"test/documentTemplate/removingWhiteSpaceInPdfEditableFieldsIT/remove_fieldSpaces.pdf");
Expand All @@ -65,7 +64,7 @@ public void removeWhiteSpaceInPdfEditableFields() {
public void removeWhiteSpaceInPdfEditableFields_has_no_effect_if_fieldsNotEditable() {
documentTemplate.withDocumentCreationOptions(
DocumentCreationOptions.getInstance()
.withPdfOptions(PdfOptions.getInstance())
.keepFormFieldsEditableInPdf(false)
.removeWhiteSpaceInPdfEditableFields(true));

File resultFile = makeFile(
Expand All @@ -81,7 +80,7 @@ public void removeWhiteSpaceInPdfEditableFields_has_no_effect_if_fieldsNotEditab
public void removeWhiteSpaceInPdfEditableFields_has_no_effect_if_output_is_doc() {
documentTemplate.withDocumentCreationOptions(
DocumentCreationOptions.getInstance()
.withPdfOptions(PdfOptions.getInstance())
.keepFormFieldsEditableInPdf(true)
.removeWhiteSpaceInPdfEditableFields(true));

File resultFile = makeFile("test/documentTemplate/removingWhiteSpaceInPdfEditableFieldsIT/aDoc.doc");
Expand All @@ -96,7 +95,7 @@ public void removeWhiteSpaceInPdfEditableFields_has_no_effect_if_output_is_doc()
public void removeWhiteSpaceInPdfEditableFields_has_no_effect_if_output_is_docx() {
documentTemplate.withDocumentCreationOptions(
DocumentCreationOptions.getInstance()
.withPdfOptions(PdfOptions.getInstance())
.keepFormFieldsEditableInPdf(true)
.removeWhiteSpaceInPdfEditableFields(true));

File resultFile = makeFile("test/documentTemplate/removingWhiteSpaceInPdfEditableFieldsIT/aDocx.docx");
Expand All @@ -111,7 +110,7 @@ public void removeWhiteSpaceInPdfEditableFields_has_no_effect_if_output_is_docx(
public void removeWhiteSpaceInPdfEditableFields_has_no_effect_if_output_is_odt() {
documentTemplate.withDocumentCreationOptions(
DocumentCreationOptions.getInstance()
.withPdfOptions(PdfOptions.getInstance())
.keepFormFieldsEditableInPdf(true)
.removeWhiteSpaceInPdfEditableFields(true));

File resultFile = makeFile("test/documentTemplate/removingWhiteSpaceInPdfEditableFieldsIT/anOdt.odt");
Expand All @@ -126,7 +125,7 @@ public void removeWhiteSpaceInPdfEditableFields_has_no_effect_if_output_is_odt()
public void removeWhiteSpaceInPdfEditableFields_has_no_effect_if_output_is_html() {
documentTemplate.withDocumentCreationOptions(
DocumentCreationOptions.getInstance()
.withPdfOptions(PdfOptions.getInstance())
.keepFormFieldsEditableInPdf(true)
.removeWhiteSpaceInPdfEditableFields(true));

File resultFile = makeFile("test/documentTemplate/removingWhiteSpaceInPdfEditableFieldsIT/anHtml.html");
Expand All @@ -141,7 +140,7 @@ public void removeWhiteSpaceInPdfEditableFields_has_no_effect_if_output_is_html(
public void removeWhiteSpaceInPdfEditableFields_has_no_effect_if_output_is_txt() {
documentTemplate.withDocumentCreationOptions(
DocumentCreationOptions.getInstance()
.withPdfOptions(PdfOptions.getInstance())
.keepFormFieldsEditableInPdf(true)
.removeWhiteSpaceInPdfEditableFields(true));

File resultFile = makeFile("test/documentTemplate/removingWhiteSpaceInPdfEditableFieldsIT/aTxt.txt");
Expand Down

0 comments on commit 9ca0cae

Please sign in to comment.