@Test
public void testExceptionHandlingWithReflection() throws Exception {

    DefaultPackagingService service = new DefaultPackagingService();
    service.jcrPackageManagerClazz = FailingJcrPackageManager.class;
    new OakMachine.Builder().build().adminInitAndInspect(session -> {
        JcrPackageManager manager = service.getPackageManager(session);
        assertTrue(manager instanceof JcrPackageManagerImpl);
    });
}