Prev |  | Next

## 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)
      ;
    }

Prev | Up | Next
6.2. Does Content Fit in Predefined Form Fields? | Home | 6.4. Authorized Signature of the new CEO