@Test
public void testEncryptedRar() throws Exception {

    Parser parser = new RarParser();
    
    try (InputStream input = RarParserTest.class.getResourceAsStream(
            "/test-documents/test-documents-enc.rar")) {
        Metadata metadata = new Metadata();
        ContentHandler handler = new BodyContentHandler();
        ParseContext context = new ParseContext();
        context.set(PasswordProvider.class, new PasswordProvider() {
            @Override
            public String getPassword(Metadata metadata) {
                return "ApacheTika";
            }
        });
    
        // Note - we don't currently support encrypted RAR
        // files so we can't check the contents
        parser.parse(input, handler, metadata, trackingContext);
        fail("No support yet for Encrypted RAR files");
    } catch (EncryptedDocumentException e) {
        // Good, as expected right now
    }
}