Source:
public void setUp() throws Exception { Environment env = Environment.getDefault(); nuxeoHome = env.getServerHome(); nuxeoConf = new File(nuxeoHome, "bin"); nuxeoConf.mkdirs(); nuxeoConf = new File(nuxeoConf, ConfigurationGenerator.NUXEO_CONF); FileUtils.copy(FileUtils.getResourceFileFromContext("configurator/nuxeo.conf"), nuxeoConf); System.setProperty(ConfigurationGenerator.NUXEO_CONF, nuxeoConf.getPath()); FileUtils.copy(FileUtils.getResourceFileFromContext("templates/jboss"), new File(nuxeoHome, "templates")); System.setProperty("jboss.home.dir", nuxeoHome.getPath()); setupWizardActionBean = new SetupWizardActionBean(); setupWizardActionBean.getConfigurationGenerator(); capturedLog.assertHasEvent(); String[] expectedFixedEvents = { "Unknown server.", "Server will be considered as not configurable.", "Parameter mail.transport.username is deprecated - please use mail.transport.user instead", "Parameter mail.transport.username is deprecated - please use mail.transport.user instead", "Missing value for nuxeo.db.type, using default" }; List<String> fixedIntersect = Arrays.asList(expectedFixedEvents).stream() .filter(capturedLog.getCaughtEventMessages()::contains) .collect(Collectors.toList()); assertEquals("Unexpected number of fixed error messages", expectedFixedEvents.length, fixedIntersect.size()); Pattern expectedEventRegexPattern = Pattern.compile("Template 'oldchange' not found with relative or absolute path (.*). Check your nuxeo.templates parameter, and nuxeo.template.includes for included files."); List<String> variableIntersect = capturedLog.getCaughtEventMessages().stream() .filter(expectedEventRegexPattern.asPredicate()) .collect(Collectors.toList()); assertEquals("Unexpected number of variable error messages", 1, variableIntersect.size()); }

Target:
public void setUp() throws Exception { Environment env = Environment.getDefault(); nuxeoHome = env.getServerHome(); nuxeoConf = new File(nuxeoHome, "bin"); nuxeoConf.mkdirs(); nuxeoConf = new File(nuxeoConf, ConfigurationGenerator.NUXEO_CONF); FileUtils.copy(FileUtils.getResourceFileFromContext("configurator/nuxeo.conf"), nuxeoConf); System.setProperty(ConfigurationGenerator.NUXEO_CONF, nuxeoConf.getPath()); FileUtils.copy(FileUtils.getResourceFileFromContext("templates/jboss"), new File(nuxeoHome, "templates")); System.setProperty("jboss.home.dir", nuxeoHome.getPath()); setupWizardActionBean = new SetupWizardActionBean(); setupWizardActionBean.getConfigurationGenerator(); capturedLog.assertHasEvent(); String[] expectedFixedEvents = { "Unknown server.", "Server will be considered as not configurable.", "Parameter mail.transport.username is deprecated - please use mail.transport.user instead", "Parameter mail.transport.username is deprecated - please use mail.transport.user instead", "Missing value for nuxeo.db.type, using default" }; List<String> fixedIntersect = Stream.of(expectedFixedEvents).filter(capturedLog.getCaughtEventMessages()::contains) .collect(Collectors.toList()); assertEquals("Unexpected number of fixed error messages", expectedFixedEvents.length, fixedIntersect.size()); Pattern expectedEventRegexPattern = Pattern.compile("Template 'oldchange' not found with relative or absolute path (.*). Check your nuxeo.templates parameter, and nuxeo.template.includes for included files."); List<String> variableIntersect = capturedLog.getCaughtEventMessages().stream() .filter(expectedEventRegexPattern.asPredicate()) .collect(Collectors.toList()); assertEquals("Unexpected number of variable error messages", 1, variableIntersect.size()); }