@Test
public void testEncryptedPdf() throws Throwable {

	thrown.expect(IOException.class);
	thrown.expectMessage("");
	thrown.expectCause(new CauseMatcher(EncryptedDocumentException.class, "Unable to process: document is encrypted"));
	final int read;
	TikaDocument tikaDocument = extractor.extract(Paths.get(getClass().getResource("/documents/pdf/encrypted.pdf").getPath()));
	try (final Reader reader = tikaDocument.getReader()) {
		read = reader.read();
	} catch (IOException e) {
		Assert.assertEquals("application/pdf", tikaDocument.getMetadata().get(Metadata.CONTENT_TYPE));
		throw e;
	}
	Assert.fail(String.format("Read \"%d\" while expecting exception.", read));
}