{
URL url = new URL("http://localhost:8080/xwiki/bin/export/Main/WebHome?format=pdf");
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
InputStream is = connection.getInputStream();
PDDocument pdd = PDDocument.load(is);
PDFTextStripper stripper = new PDFTextStripper();
String text = stripper.getText(pdd);
pdd.close();
is.close();
assertTrue("Invalid content", text.contains("Welcome to your wiki"));
}