Skip to content

Commit

Permalink
Made Merge and rename the default policy. Fixed tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
torakiki committed Mar 22, 2024
1 parent e78cceb commit e47d4e2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class MergeParametersBuilder extends AbstractPdfOutputParametersBuilder<MergePar
private boolean blankIfOdd;
private boolean footer;
private PageNormalizationPolicy pageNormalizationPolicy = PageNormalizationPolicy.NONE;
private AcroFormPolicy formsPolicy = AcroFormPolicy.MERGE;
private AcroFormPolicy formsPolicy = AcroFormPolicy.MERGE_RENAMING_EXISTING_FIELDS;
private ToCPolicy tocPolicy = ToCPolicy.NONE;
private FileTaskOutput output;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public void validSteps() {
verify(builder).blankPageIfOdd(true);
verify(builder).footer(false);
verify(builder).pageNormalizationPolicy(PageNormalizationPolicy.NONE);
verify(builder).acroFormsPolicy(AcroFormPolicy.MERGE);
verify(builder).acroFormsPolicy(AcroFormPolicy.MERGE_RENAMING_EXISTING_FIELDS);
verify(builder).tocPolicy(ToCPolicy.NONE);
verify(onError, never()).accept(anyString());
}
Expand All @@ -96,7 +96,7 @@ public void onSaveWorkspace() {
assertEquals(Boolean.TRUE.toString(), data.get("blankIfOdd"));
assertEquals(Boolean.FALSE.toString(), data.get("footer"));
assertEquals(PageNormalizationPolicy.NONE.toString(), data.get("pageNormalization"));
assertEquals(AcroFormPolicy.MERGE.toString(), data.get("acroForms"));
assertEquals(AcroFormPolicy.MERGE_RENAMING_EXISTING_FIELDS.toString(), data.get("acroForms"));
assertEquals(ToCPolicy.NONE.toString(), data.get("toc"));
}

Expand Down Expand Up @@ -145,22 +145,22 @@ public void reset() {
ComboBox<ComboItem<PageNormalizationPolicy>> normalize = robot.lookup("#normalizeCheck").queryComboBox();
Map<String, String> data = new HashMap<>();
data.put("outline", OutlinePolicy.ONE_ENTRY_EACH_DOC.toString());
data.put("acroForms", AcroFormPolicy.MERGE_RENAMING_EXISTING_FIELDS.toString());
data.put("acroForms", AcroFormPolicy.FLATTEN.toString());
data.put("blankIfOdd", Boolean.TRUE.toString());
data.put("footer", Boolean.TRUE.toString());
data.put("pageNormalization", PageNormalizationPolicy.SAME_WIDTH_ORIENTATION_BASED.toString());
data.put("toc", ToCPolicy.DOC_TITLES.toString());
WaitForAsyncUtils.waitForAsyncFx(2000, () -> victim.restoreStateFrom(data));
assertEquals(OutlinePolicy.ONE_ENTRY_EACH_DOC, outline.getSelectionModel().getSelectedItem().key());
assertEquals(AcroFormPolicy.MERGE_RENAMING_EXISTING_FIELDS, forms.getSelectionModel().getSelectedItem().key());
assertEquals(AcroFormPolicy.FLATTEN, forms.getSelectionModel().getSelectedItem().key());
assertEquals(ToCPolicy.DOC_TITLES, toc.getSelectionModel().getSelectedItem().key());
assertTrue(blankIfOdd.isSelected());
assertTrue(footer.isSelected());
assertEquals(PageNormalizationPolicy.SAME_WIDTH_ORIENTATION_BASED,
normalize.getSelectionModel().getSelectedItem().key());
WaitForAsyncUtils.waitForAsyncFx(2000, () -> victim.resetView());
assertEquals(OutlinePolicy.RETAIN, outline.getSelectionModel().getSelectedItem().key());
assertEquals(AcroFormPolicy.MERGE, forms.getSelectionModel().getSelectedItem().key());
assertEquals(AcroFormPolicy.MERGE_RENAMING_EXISTING_FIELDS, forms.getSelectionModel().getSelectedItem().key());
assertEquals(ToCPolicy.NONE, toc.getSelectionModel().getSelectedItem().key());
assertFalse(blankIfOdd.isSelected());
assertFalse(footer.isSelected());
Expand Down

0 comments on commit e47d4e2

Please sign in to comment.