@@ -0,0 +1,2134 @@
+package annis.libgui;%0A%0Aimport static org.junit.jupiter.api.Assertions.assertEquals;%0Aimport static org.junit.jupiter.api.Assertions.assertNull;%0Aimport static org.mockito.Mockito.mock;%0Aimport static org.mockito.Mockito.when;%0A%0Aimport annis.libgui.visualizers.VisualizerInput;%0Aimport org.corpus_tools.salt.SaltFactory;%0Aimport org.corpus_tools.salt.common.SDocument;%0Aimport org.corpus_tools.salt.common.SDocumentGraph;%0Aimport org.corpus_tools.salt.core.SNode;%0Aimport org.corpus_tools.salt.samples.SampleGenerator;%0Aimport org.junit.jupiter.api.BeforeEach;%0Aimport org.junit.jupiter.api.Test;%0A%0Aclass PDFPageHelperTest %7B%0A%0A  VisualizerInput visInput;%0A  private SDocumentGraph graph;%0A  private SNode pageNode;%0A%0A  @BeforeEach%0A  void setUp() throws Exception %7B%0A    visInput = mock(VisualizerInput.class);%0A%0A    SDocument document = SaltFactory.createSDocument();%0A    SampleGenerator.createTokens(document);%0A    graph = document.getDocumentGraph();%0A    pageNode = graph.getTokens().get(0);%0A%0A  %7D%0A%0A  @Test%0A  void getPageFromAnnotationNullSafety() %7B%0A%0A    PDFPageHelper pdfPageHelper = new PDFPageHelper(visInput);%0A%0A    assertNull(pdfPageHelper.getPageFromAnnotation(null));%0A    assertNull(pdfPageHelper.getPageFromAnnotation(SaltFactory.createSNode()));%0A  %7D%0A%0A  @Test%0A  void getPageFromAnnotatioNoNamespace() %7B%0A%0A    PDFPageHelper pdfPageHelper = new PDFPageHelper(visInput);%0A%0A    pageNode.createAnnotation(null, %22page%22, %2223%22);%0A    assertEquals(%2223%22, pdfPageHelper.getPageFromAnnotation(pageNode));%0A%0A  %7D%0A%0A  @Test%0A  void getPageFromAnnotatioWithNamespace() %7B%0A%0A    when(visInput.getNamespace()).thenReturn(%22morphology%22);%0A    PDFPageHelper pdfPageHelper = new PDFPageHelper(visInput);%0A    %0A    // Test that namespace is checked%0A    pageNode.createAnnotation(%22some_ns%22, %22page%22, %2242%22);%0A    assertEquals(%2242%22, pdfPageHelper.getPageFromAnnotation(pageNode));%0A  %7D%0A%0A  @Test%0A  void getPageFromAnnotatioWithNonExistingNamespace() %7B%0A%0A    when(visInput.getNamespace()).thenReturn(%22another_ns%22);%0A    PDFPageHelper pdfPageHelper = new PDFPageHelper(visInput);%0A%0A    // Test that namespace is checked%0A    assertNull(pdfPageHelper.getPageFromAnnotation(pageNode));%0A  %7D%0A%0A%7D%0A

Add tests for PDFPageHelper#getPageFromAnnotation