6.3.  Name of the Former CEO

Initial Situation

The board of executives has changed.

Problem

The name of the former CEO must be changed in the header of newly created PDF documents.

Solution Approach

PDFUnit provides methods to check documents for the non-existence of text.

Solution

@Test
public void verifyOldCEONotPresent() throws Exception {
  String filename = "documentUnderTest.pdf";
  String oldCEO = "NameOfOldCEO";
  PageRegion header = createHeaderRegion();
  
  AssertThat.document(filename)
            .restrictedTo(header)
            .hasText() 
            .notContaining(oldCEO) 
  ;
}