@Test(expected = AbortedScanException.class)
public void testScanWithInitStage_throws() throws Exception {

    final File testPackage = TestPackageUtil.prepareTestPackage("tmp_foo_bar.zip");
    final Properties userProps = new Properties();
    // force a different admin id to prevent login with the default admin
    userProps.put(UserConstants.PARAM_ADMIN_ID, "anotheradmin");
    final Properties securityProps = new Properties();
    securityProps.put(UserConfiguration.NAME, ConfigurationParameters.of(userProps));
    builder()
            .withJcrCustomizer(jcr -> {
                jcr.with(new SecurityProviderImpl(ConfigurationParameters.of(securityProps)));
            })
            .build().scanPackage(testPackage);
}