diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index db0c4821..9fbe024b 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -215,7 +215,7 @@ jobs:
steps:
- name: Download artifacts
- uses: actions/download-artifact@v3
+ uses: actions/download-artifact@v4
with:
name: artifacts
diff --git a/pom.xml b/pom.xml
index d6feb6ec..2093d628 100644
--- a/pom.xml
+++ b/pom.xml
@@ -7,7 +7,7 @@
com.github.beatngu13
pdfzoomwizard
- 0.12.1
+ 0.13.0
PDF Zoom Wizard
@@ -17,6 +17,7 @@
${encoding}
17
20.0.2
+ 5.8.0
com.github.beatngu13.pdfzoomwizard.LauncherWrapper
beatngu13_pdf-zoom-wizard
beatngu13
@@ -52,7 +53,7 @@
ch.qos.logback
logback-classic
- 1.4.11
+ 1.4.14
@@ -60,35 +61,41 @@
org.junit.jupiter
junit-jupiter
- 5.10.0
+ 5.10.1
test
org.assertj
assertj-core
- 3.24.2
+ 3.25.0
test
org.mockito
mockito-core
- 5.6.0
+ ${mockito.version}
+ test
+
+
+ org.mockito
+ mockito-junit-jupiter
+ ${mockito.version}
test
com.approvaltests
approvaltests
- 22.2.0
+ 22.3.3
test
com.itextpdf
kernel
- 8.0.1
+ 8.0.2
test
@@ -114,7 +121,7 @@
org.apache.maven.plugins
maven-compiler-plugin
- 3.11.0
+ 3.12.1
${java.version}
@@ -123,7 +130,7 @@
org.apache.maven.plugins
maven-surefire-plugin
- 3.2.1
+ 3.2.3
@@ -137,7 +144,7 @@
org.apache.maven.plugins
maven-failsafe-plugin
- 3.2.1
+ 3.2.3
${project.build.directory}/surefire-reports/
@@ -192,7 +199,7 @@
com.gluonhq
gluonfx-maven-plugin
- 1.0.21
+ 1.0.22
${mainClass}
${java.version}
@@ -214,7 +221,7 @@
com.amashchenko.maven.plugin
gitflow-maven-plugin
- 1.20.0
+ 1.21.0
true
true
diff --git a/scripts/start-hotfix.sh b/scripts/start-hotfix.sh
index 4fdbf73a..afa74af8 100755
--- a/scripts/start-hotfix.sh
+++ b/scripts/start-hotfix.sh
@@ -2,4 +2,4 @@
set -x
-./mvnw -B gitflow:hotfix-start
+./mvnw -B gitflow:hotfix-start -DhotfixBranch="$1"
diff --git a/src/main/java/com/github/beatngu13/pdfzoomwizard/core/Wizard.java b/src/main/java/com/github/beatngu13/pdfzoomwizard/core/Wizard.java
index cb830f3c..23cfc786 100644
--- a/src/main/java/com/github/beatngu13/pdfzoomwizard/core/Wizard.java
+++ b/src/main/java/com/github/beatngu13/pdfzoomwizard/core/Wizard.java
@@ -149,13 +149,19 @@ private void modifyFile(File file) {
* @param bookmarks Bookmarks to be modified.
*/
void modifyBookmarks(Bookmarks bookmarks) {
+ Bookmark previous = null;
for (Bookmark bookmark : bookmarks) {
- var children = bookmark.getBookmarks();
+ // Bookmarks#iterator() might be endless.
+ if (bookmark.equals(previous)) {
+ break;
+ }
+ Bookmarks children = bookmark.getBookmarks();
// Size might be positive (bookmark open) or negative (bookmark closed).
if (children.size() != 0) {
modifyBookmarks(children);
}
modifyBookmark(bookmark);
+ previous = bookmark;
}
}
diff --git a/src/main/java/com/github/beatngu13/pdfzoomwizard/ui/MainViewController.java b/src/main/java/com/github/beatngu13/pdfzoomwizard/ui/MainViewController.java
index ca6cabd1..492c8971 100644
--- a/src/main/java/com/github/beatngu13/pdfzoomwizard/ui/MainViewController.java
+++ b/src/main/java/com/github/beatngu13/pdfzoomwizard/ui/MainViewController.java
@@ -21,6 +21,8 @@
import org.slf4j.LoggerFactory;
import java.io.File;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
/**
* Provides a JavaFX-based Wizard UI.
@@ -31,6 +33,10 @@ public class MainViewController {
private static final Logger logger = LoggerFactory.getLogger(MainViewController.class);
+ /**
+ * ExecutorService
for running {@link Wizard} tasks.
+ */
+ private final ExecutorService executorService = Executors.newSingleThreadExecutor();
/**
* Provides the last directory for {@link #directoryChooser} and
* {@link #fileChooser}.
@@ -204,11 +210,12 @@ private boolean logAndShow(String msg) {
* @return Confirmation message for directory/file to be overwritten/copied.
*/
private String getConfirmationMessage() {
- var prefix = multipleMode
- ? "All files in '" + root.getAbsolutePath() + "' and its enclosing subdirectories will be "
- : "File '" + root.getAbsolutePath() + "' will be ";
+ var prefix = (multipleMode
+ ? "All files in '%s' and its enclosing subdirectories will be "
+ : "File '%s' will be ")
+ .formatted(root.getAbsolutePath());
var infix = copyCheckBox.isSelected() ? "copied." : "overwritten.";
- var suffix = "\n\nAre you sure to proceed?";
+ var suffix = System.lineSeparator().repeat(2) + "Are you sure to proceed?";
return prefix + infix + suffix;
}
@@ -219,11 +226,9 @@ private String getConfirmationMessage() {
private void run() {
var filenameInfix = copyCheckBox.isSelected() ? copyTextField.getText() : null;
var wizard = new Wizard(root, filenameInfix, zoomChoiceBox.getValue());
- var thread = new Thread(wizard);
// Can't be bound because infoText is also set within here.
wizard.messageProperty().addListener((observable, oldValue, newValue) -> infoText.setText(newValue));
- thread.setDaemon(true);
- thread.start();
+ executorService.submit(wizard);
}
}
diff --git a/src/test/java/com/github/beatngu13/pdfzoomwizard/TestUtil.java b/src/test/java/com/github/beatngu13/pdfzoomwizard/TestUtil.java
deleted file mode 100644
index 2459af5c..00000000
--- a/src/test/java/com/github/beatngu13/pdfzoomwizard/TestUtil.java
+++ /dev/null
@@ -1,53 +0,0 @@
-package com.github.beatngu13.pdfzoomwizard;
-
-import com.github.beatngu13.pdfzoomwizard.core.Zoom;
-import com.itextpdf.kernel.pdf.PdfDocument;
-import com.itextpdf.kernel.pdf.PdfObject;
-import com.itextpdf.kernel.pdf.PdfOutline;
-import com.itextpdf.kernel.pdf.PdfReader;
-import com.itextpdf.kernel.pdf.navigation.PdfDestination;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.UncheckedIOException;
-import java.util.List;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-
-public class TestUtil {
-
- private TestUtil() {
- }
-
- public static String toStringNormalized(Zoom zoom) {
- return zoom.toString()
- .toLowerCase()
- .replaceAll(" ", "_");
- }
-
- public static List getAllPdfObjects(File pdf) {
- return getAllBookmarks(pdf)
- .map(PdfOutline::getDestination)
- .map(PdfDestination::getPdfObject)
- .collect(Collectors.toList());
- }
-
- private static Stream getAllBookmarks(File pdf) {
- try (PdfDocument doc = new PdfDocument(new PdfReader(pdf))) {
- return doc.getOutlines(true)
- .getAllChildren()
- .stream()
- .flatMap(TestUtil::streamRecursive);
- } catch (IOException e) {
- throw new UncheckedIOException(e);
- }
- }
-
- private static Stream streamRecursive(PdfOutline bookmark) {
- Stream allChildren = bookmark.getAllChildren()
- .stream()
- .flatMap(TestUtil::streamRecursive);
- return Stream.concat(Stream.of(bookmark), allChildren);
- }
-
-}
diff --git a/src/test/java/com/github/beatngu13/pdfzoomwizard/core/BookmarkUtilTest.java b/src/test/java/com/github/beatngu13/pdfzoomwizard/core/BookmarkUtilTest.java
index 5b425788..1e532303 100644
--- a/src/test/java/com/github/beatngu13/pdfzoomwizard/core/BookmarkUtilTest.java
+++ b/src/test/java/com/github/beatngu13/pdfzoomwizard/core/BookmarkUtilTest.java
@@ -1,25 +1,29 @@
package com.github.beatngu13.pdfzoomwizard.core;
import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.mockito.Mock;
+import org.mockito.junit.jupiter.MockitoExtension;
import org.pdfclown.documents.interaction.navigation.document.Bookmark;
import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
+@ExtendWith(MockitoExtension.class)
class BookmarkUtilTest {
+ @Mock
+ Bookmark bookmark;
+
@Test
void bookmark_title_should_be_used_when_available() {
var title = "foo";
- var bookmark = mock(Bookmark.class);
when(bookmark.getTitle()).thenReturn(title);
assertThat(BookmarkUtil.getTitle(bookmark)).isEqualTo(title);
}
@Test
void fallback_title_should_be_used_when_exception_occurs() {
- var bookmark = mock(Bookmark.class);
when(bookmark.getTitle()).thenThrow(RuntimeException.class);
assertThat(BookmarkUtil.getTitle(bookmark)).isEqualTo(BookmarkUtil.BOOKMARK_TITLE_FALLBACK);
}
diff --git a/src/test/java/com/github/beatngu13/pdfzoomwizard/core/WizardIT.java b/src/test/java/com/github/beatngu13/pdfzoomwizard/core/WizardIT.java
index 721af217..18be00d3 100644
--- a/src/test/java/com/github/beatngu13/pdfzoomwizard/core/WizardIT.java
+++ b/src/test/java/com/github/beatngu13/pdfzoomwizard/core/WizardIT.java
@@ -1,10 +1,6 @@
package com.github.beatngu13.pdfzoomwizard.core;
-import com.github.beatngu13.pdfzoomwizard.TestUtil;
-import com.itextpdf.kernel.pdf.PdfObject;
import org.approvaltests.Approvals;
-import org.approvaltests.namer.NamedEnvironment;
-import org.approvaltests.namer.NamerFactory;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
@@ -17,7 +13,6 @@
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.StandardCopyOption;
-import java.util.List;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatCode;
@@ -40,22 +35,19 @@ void setUp(@TempDir Path temp) throws Exception {
}
@ParameterizedTest
- @EnumSource(Zoom.class)
+ @EnumSource
void zoom_should_be_applied_properly(Zoom zoom) {
- var zoomName = TestUtil.toStringNormalized(zoom);
- try (NamedEnvironment env = NamerFactory.withParameters(zoomName)) {
- new Wizard(pdf, null, zoom).call();
- List pdfObjects = TestUtil.getAllPdfObjects(pdf);
- Approvals.verify(pdfObjects);
- }
+ var zoomName = zoom.name().toLowerCase();
+ new Wizard(pdf, null, zoom).call();
+ var bookmarks = WizardITUtil.getBookmarks(pdf);
+ Approvals.verifyAll(bookmarks.toArray(), Object::toString, Approvals.NAMES.withParameters(zoomName));
}
@Test
void should_overwrite_pdf_if_infix_is_null() {
new Wizard(pdf, null, Zoom.INHERIT_ZOOM).call();
- assertThat(pdf.getParentFile().listFiles())
- .extracting(File::getName)
- .containsExactly(pdfName);
+ assertThat(pdf.getParentFile())
+ .isDirectoryContaining(file -> file.getName().equals(pdfName));
}
@Test
@@ -63,9 +55,9 @@ void should_copy_pdf_if_infix_is_not_null() {
var pdfInfix = "-infix";
new Wizard(pdf, pdfInfix, Zoom.INHERIT_ZOOM).call();
var pdfCopyName = pdfPrefix + pdfInfix + pdfSuffix;
- assertThat(pdf.getParentFile().listFiles())
- .extracting(File::getName)
- .containsExactlyInAnyOrder(pdfName, pdfCopyName);
+ assertThat(pdf.getParentFile())
+ .isDirectoryContaining(file -> file.getName().equals(pdfName))
+ .isDirectoryContaining(file -> file.getName().equals(pdfCopyName));
}
}
diff --git a/src/test/java/com/github/beatngu13/pdfzoomwizard/core/WizardITUtil.java b/src/test/java/com/github/beatngu13/pdfzoomwizard/core/WizardITUtil.java
new file mode 100644
index 00000000..cd9ccb1c
--- /dev/null
+++ b/src/test/java/com/github/beatngu13/pdfzoomwizard/core/WizardITUtil.java
@@ -0,0 +1,59 @@
+package com.github.beatngu13.pdfzoomwizard.core;
+
+import com.itextpdf.kernel.pdf.PdfDocument;
+import com.itextpdf.kernel.pdf.PdfOutline;
+import com.itextpdf.kernel.pdf.PdfReader;
+import com.itextpdf.kernel.pdf.navigation.PdfDestination;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.UncheckedIOException;
+import java.util.List;
+import java.util.stream.Stream;
+
+final class WizardITUtil {
+
+ record Bookmark(String title, String data) {
+ }
+
+ private WizardITUtil() {
+ }
+
+ static List getBookmarks(File pdf) {
+ return streamOutlines(pdf)
+ .map(WizardITUtil::toBookmark)
+ .toList();
+ }
+
+ private static Stream streamOutlines(File pdf) {
+ try (PdfDocument doc = new PdfDocument(new PdfReader(pdf))) {
+ PdfOutline outlines = doc.getOutlines(true);
+ if (outlines == null) {
+ return Stream.empty();
+ }
+ return outlines
+ .getAllChildren()
+ .stream()
+ .flatMap(WizardITUtil::streamOutlines);
+ } catch (IOException e) {
+ throw new UncheckedIOException(e);
+ }
+ }
+
+ private static Stream streamOutlines(PdfOutline outline) {
+ Stream allChildren = outline.getAllChildren()
+ .stream()
+ .flatMap(WizardITUtil::streamOutlines);
+ return Stream.concat(Stream.of(outline), allChildren);
+ }
+
+ private static Bookmark toBookmark(PdfOutline outline) {
+ String title = outline.getTitle();
+ PdfDestination destination = outline.getDestination();
+ String data = destination == null
+ ? "No destination"
+ : destination.getPdfObject().toString();
+ return new Bookmark(title, data);
+ }
+
+}
diff --git a/src/test/java/com/github/beatngu13/pdfzoomwizard/core/WizardTest.java b/src/test/java/com/github/beatngu13/pdfzoomwizard/core/WizardTest.java
index 6ae60521..1271f941 100644
--- a/src/test/java/com/github/beatngu13/pdfzoomwizard/core/WizardTest.java
+++ b/src/test/java/com/github/beatngu13/pdfzoomwizard/core/WizardTest.java
@@ -1,76 +1,81 @@
package com.github.beatngu13.pdfzoomwizard.core;
+import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.Timeout;
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.mockito.Mock;
+import org.mockito.Mock.Strictness;
+import org.mockito.junit.jupiter.MockitoExtension;
import org.pdfclown.documents.interaction.navigation.document.Bookmark;
import org.pdfclown.documents.interaction.navigation.document.Bookmarks;
-import org.pdfclown.objects.PdfObjectWrapper;
import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import java.util.stream.Stream;
import static org.assertj.core.api.Assertions.assertThatCode;
-import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
+@ExtendWith(MockitoExtension.class)
class WizardTest {
- @Test
- void get_target_exception_should_not_crash_execution() {
- var cut = new Wizard(null, null, Zoom.ACTUAL_SIZE);
+ @Mock
+ Bookmark bookmark;
+ @Mock
+ Bookmarks bookmarks;
+ @Mock(strictness = Strictness.LENIENT)
+ Bookmarks childBookmarks;
- var bookmark = mock(Bookmark.class);
- when(bookmark.getBookmarks()).thenReturn(mock(Bookmarks.class));
- when(bookmark.getTarget()).thenThrow(RuntimeException.class);
+ Iterator bookmarksIterator;
+ Iterator childBookmarksIterator;
- var bookmarkIter = Collections.singleton(bookmark).iterator();
+ Wizard cut = new Wizard(null, null, Zoom.ACTUAL_SIZE);
+
+ @BeforeEach
+ void setUp() {
+ bookmarksIterator = List.of(bookmark).iterator();
+ childBookmarksIterator = Collections.emptyIterator();
+
+ when(bookmark.getBookmarks()).thenReturn(childBookmarks);
+ when(bookmarks.iterator()).thenReturn(bookmarksIterator);
+ when(childBookmarks.iterator()).thenReturn(childBookmarksIterator);
+ }
- var bookmarks = mock(Bookmarks.class);
- when(bookmarks.iterator()).thenReturn(bookmarkIter);
+ @Test
+ void get_target_exception_should_not_crash_execution() {
+ when(bookmark.getTarget()).thenThrow(RuntimeException.class);
assertThatCode(() -> cut.modifyBookmarks(bookmarks)).doesNotThrowAnyException();
}
@Test
void get_target_null_should_not_crash_execution() {
- var cut = new Wizard(null, null, Zoom.ACTUAL_SIZE);
-
- var bookmark = mock(Bookmark.class);
- when(bookmark.getBookmarks()).thenReturn(mock(Bookmarks.class));
when(bookmark.getTarget()).thenReturn(null);
- var bookmarkIter = Collections.singleton(bookmark).iterator();
-
- var bookmarks = mock(Bookmarks.class);
- when(bookmarks.iterator()).thenReturn(bookmarkIter);
-
assertThatCode(() -> cut.modifyBookmarks(bookmarks)).doesNotThrowAnyException();
}
- @SuppressWarnings("unchecked")
@Test
void closed_bookmarks_should_be_modified() {
- var cut = spy(new Wizard(null, null, Zoom.ACTUAL_SIZE));
-
- var childBookmarksIter = Collections.emptyIterator();
-
- var childBookmarks = mock(Bookmarks.class);
- when(childBookmarks.iterator()).thenReturn(childBookmarksIter);
- // Negative count means closed bookmark.
+ var cut = spy(this.cut);
when(childBookmarks.size()).thenReturn(-1);
- var bookmark = mock(Bookmark.class);
- when(bookmark.getBookmarks()).thenReturn(childBookmarks);
- when(bookmark.getTarget()).thenReturn(mock(PdfObjectWrapper.class));
-
- var bookmarksIter = Collections.singleton(bookmark).iterator();
-
- var bookmarks = mock(Bookmarks.class);
- when(bookmarks.iterator()).thenReturn(bookmarksIter);
-
cut.modifyBookmarks(bookmarks);
verify(cut).modifyBookmarks(childBookmarks);
}
+ @Test
+ @Timeout(1)
+ void endless_bookmark_iterator_should_be_stopped() {
+ var bookmarksIterator = Stream.generate(() -> bookmark).iterator();
+ when(bookmarks.iterator()).thenReturn(bookmarksIterator);
+
+ assertThatCode(() -> cut.modifyBookmarks(bookmarks)).doesNotThrowAnyException();
+ }
+
}
diff --git a/src/test/java/com/github/beatngu13/pdfzoomwizard/core/ZoomTest.java b/src/test/java/com/github/beatngu13/pdfzoomwizard/core/ZoomTest.java
index 119736eb..5e488ae5 100644
--- a/src/test/java/com/github/beatngu13/pdfzoomwizard/core/ZoomTest.java
+++ b/src/test/java/com/github/beatngu13/pdfzoomwizard/core/ZoomTest.java
@@ -12,12 +12,12 @@
class ZoomTest {
@ParameterizedTest
- @MethodSource("args")
+ @MethodSource
void to_string_should_be_formatted(Zoom zoom, String formatted) {
assertThat(zoom).hasToString(formatted);
}
- static Stream args() {
+ static Stream to_string_should_be_formatted() {
return Stream.of(
arguments(Zoom.ACTUAL_SIZE, "Actual size"),
arguments(Zoom.FIT_PAGE, "Fit page"),
diff --git a/src/test/java/com/github/beatngu13/pdfzoomwizard/ui/LastDirectoryProviderTest.java b/src/test/java/com/github/beatngu13/pdfzoomwizard/ui/LastDirectoryProviderTest.java
index 3a166349..1b1d5c6c 100644
--- a/src/test/java/com/github/beatngu13/pdfzoomwizard/ui/LastDirectoryProviderTest.java
+++ b/src/test/java/com/github/beatngu13/pdfzoomwizard/ui/LastDirectoryProviderTest.java
@@ -1,8 +1,10 @@
package com.github.beatngu13.pdfzoomwizard.ui;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
import org.junit.jupiter.api.io.TempDir;
+import org.mockito.Mock;
+import org.mockito.junit.jupiter.MockitoExtension;
import java.io.File;
import java.nio.file.Path;
@@ -13,20 +15,16 @@
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
-import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
+@ExtendWith(MockitoExtension.class)
class LastDirectoryProviderTest {
+ @Mock
Preferences prefs;
- LastDirectoryProvider cut;
- @BeforeEach
- void setUp() {
- prefs = mock(Preferences.class);
- cut = new LastDirectoryProvider();
- }
+ LastDirectoryProvider cut = new LastDirectoryProvider();
@Test
void set_should_not_accept_null() {
diff --git a/src/test/resources/com/github/beatngu13/pdfzoomwizard/core/WizardIT.WithPdf.zoom_should_be_applied_properly.actual_size.approved.txt b/src/test/resources/com/github/beatngu13/pdfzoomwizard/core/WizardIT.WithPdf.zoom_should_be_applied_properly.actual_size.approved.txt
index 7970fcf8..77022187 100644
--- a/src/test/resources/com/github/beatngu13/pdfzoomwizard/core/WizardIT.WithPdf.zoom_should_be_applied_properly.actual_size.approved.txt
+++ b/src/test/resources/com/github/beatngu13/pdfzoomwizard/core/WizardIT.WithPdf.zoom_should_be_applied_properly.actual_size.approved.txt
@@ -1 +1,6 @@
-[[42 0 R /XYZ 742 null 1 ], [1 0 R /XYZ 731 null 1 ], [3 0 R /XYZ 731 null 1 ], [5 0 R /XYZ 731 null 1 ], [7 0 R /XYZ 731 null 1 ], [11 0 R /XYZ 731 null 1 ]]
+Bookmark[title=Working with Bookmarks , data=[42 0 R /XYZ 742 null 1 ]]
+Bookmark[title=Creating New Bookmarks , data=[1 0 R /XYZ 731 null 1 ]]
+Bookmark[title=Creating a Bookmark Hierarchy , data=[3 0 R /XYZ 731 null 1 ]]
+Bookmark[title=Editing Bookmarks , data=[5 0 R /XYZ 731 null 1 ]]
+Bookmark[title=Deleting Bookmarks , data=[7 0 R /XYZ 731 null 1 ]]
+Bookmark[title=Setting Documents Properties for Bookmarks , data=[11 0 R /XYZ 731 null 1 ]]
diff --git a/src/test/resources/com/github/beatngu13/pdfzoomwizard/core/WizardIT.WithPdf.zoom_should_be_applied_properly.fit_page.approved.txt b/src/test/resources/com/github/beatngu13/pdfzoomwizard/core/WizardIT.WithPdf.zoom_should_be_applied_properly.fit_page.approved.txt
index e60afee0..abe91c7d 100644
--- a/src/test/resources/com/github/beatngu13/pdfzoomwizard/core/WizardIT.WithPdf.zoom_should_be_applied_properly.fit_page.approved.txt
+++ b/src/test/resources/com/github/beatngu13/pdfzoomwizard/core/WizardIT.WithPdf.zoom_should_be_applied_properly.fit_page.approved.txt
@@ -1 +1,6 @@
-[[42 0 R /Fit ], [1 0 R /Fit ], [3 0 R /Fit ], [5 0 R /Fit ], [7 0 R /Fit ], [11 0 R /Fit ]]
+Bookmark[title=Working with Bookmarks , data=[42 0 R /Fit ]]
+Bookmark[title=Creating New Bookmarks , data=[1 0 R /Fit ]]
+Bookmark[title=Creating a Bookmark Hierarchy , data=[3 0 R /Fit ]]
+Bookmark[title=Editing Bookmarks , data=[5 0 R /Fit ]]
+Bookmark[title=Deleting Bookmarks , data=[7 0 R /Fit ]]
+Bookmark[title=Setting Documents Properties for Bookmarks , data=[11 0 R /Fit ]]
diff --git a/src/test/resources/com/github/beatngu13/pdfzoomwizard/core/WizardIT.WithPdf.zoom_should_be_applied_properly.fit_visible.approved.txt b/src/test/resources/com/github/beatngu13/pdfzoomwizard/core/WizardIT.WithPdf.zoom_should_be_applied_properly.fit_visible.approved.txt
index 4fed13a3..a9feca40 100644
--- a/src/test/resources/com/github/beatngu13/pdfzoomwizard/core/WizardIT.WithPdf.zoom_should_be_applied_properly.fit_visible.approved.txt
+++ b/src/test/resources/com/github/beatngu13/pdfzoomwizard/core/WizardIT.WithPdf.zoom_should_be_applied_properly.fit_visible.approved.txt
@@ -1 +1,6 @@
-[[42 0 R /FitBH 742 ], [1 0 R /FitBH 731 ], [3 0 R /FitBH 731 ], [5 0 R /FitBH 731 ], [7 0 R /FitBH 731 ], [11 0 R /FitBH 731 ]]
+Bookmark[title=Working with Bookmarks , data=[42 0 R /FitBH 742 ]]
+Bookmark[title=Creating New Bookmarks , data=[1 0 R /FitBH 731 ]]
+Bookmark[title=Creating a Bookmark Hierarchy , data=[3 0 R /FitBH 731 ]]
+Bookmark[title=Editing Bookmarks , data=[5 0 R /FitBH 731 ]]
+Bookmark[title=Deleting Bookmarks , data=[7 0 R /FitBH 731 ]]
+Bookmark[title=Setting Documents Properties for Bookmarks , data=[11 0 R /FitBH 731 ]]
diff --git a/src/test/resources/com/github/beatngu13/pdfzoomwizard/core/WizardIT.WithPdf.zoom_should_be_applied_properly.fit_width.approved.txt b/src/test/resources/com/github/beatngu13/pdfzoomwizard/core/WizardIT.WithPdf.zoom_should_be_applied_properly.fit_width.approved.txt
index d8a335e1..386446ed 100644
--- a/src/test/resources/com/github/beatngu13/pdfzoomwizard/core/WizardIT.WithPdf.zoom_should_be_applied_properly.fit_width.approved.txt
+++ b/src/test/resources/com/github/beatngu13/pdfzoomwizard/core/WizardIT.WithPdf.zoom_should_be_applied_properly.fit_width.approved.txt
@@ -1 +1,6 @@
-[[42 0 R /FitH 742 ], [1 0 R /FitH 731 ], [3 0 R /FitH 731 ], [5 0 R /FitH 731 ], [7 0 R /FitH 731 ], [11 0 R /FitH 731 ]]
+Bookmark[title=Working with Bookmarks , data=[42 0 R /FitH 742 ]]
+Bookmark[title=Creating New Bookmarks , data=[1 0 R /FitH 731 ]]
+Bookmark[title=Creating a Bookmark Hierarchy , data=[3 0 R /FitH 731 ]]
+Bookmark[title=Editing Bookmarks , data=[5 0 R /FitH 731 ]]
+Bookmark[title=Deleting Bookmarks , data=[7 0 R /FitH 731 ]]
+Bookmark[title=Setting Documents Properties for Bookmarks , data=[11 0 R /FitH 731 ]]
diff --git a/src/test/resources/com/github/beatngu13/pdfzoomwizard/core/WizardIT.WithPdf.zoom_should_be_applied_properly.inherit_zoom.approved.txt b/src/test/resources/com/github/beatngu13/pdfzoomwizard/core/WizardIT.WithPdf.zoom_should_be_applied_properly.inherit_zoom.approved.txt
index 33a337c7..dbacc68f 100644
--- a/src/test/resources/com/github/beatngu13/pdfzoomwizard/core/WizardIT.WithPdf.zoom_should_be_applied_properly.inherit_zoom.approved.txt
+++ b/src/test/resources/com/github/beatngu13/pdfzoomwizard/core/WizardIT.WithPdf.zoom_should_be_applied_properly.inherit_zoom.approved.txt
@@ -1 +1,6 @@
-[[42 0 R /XYZ 742 null null ], [1 0 R /XYZ 731 null null ], [3 0 R /XYZ 731 null null ], [5 0 R /XYZ 731 null null ], [7 0 R /XYZ 731 null null ], [11 0 R /XYZ 731 null null ]]
+Bookmark[title=Working with Bookmarks , data=[42 0 R /XYZ 742 null null ]]
+Bookmark[title=Creating New Bookmarks , data=[1 0 R /XYZ 731 null null ]]
+Bookmark[title=Creating a Bookmark Hierarchy , data=[3 0 R /XYZ 731 null null ]]
+Bookmark[title=Editing Bookmarks , data=[5 0 R /XYZ 731 null null ]]
+Bookmark[title=Deleting Bookmarks , data=[7 0 R /XYZ 731 null null ]]
+Bookmark[title=Setting Documents Properties for Bookmarks , data=[11 0 R /XYZ 731 null null ]]