ReportGenerator { public void generateReport(final AllScenariosPageCollection allScenariosPageCollection) throws CluecumberPluginException { String reportDirectory = propertyManager.getGeneratedHtmlReportDirectory(); createDirectories(reportDirectory); copyStaticReportAssets(reportDirectory); copyCustomCss(reportDirectory); boolean redirectToFirstScenarioPage = propertyManager.getStartPage() == PluginSettings.StartPage.ALL_SCENARIOS && allScenariosPageCollection.getTotalNumberOfScenarios() == 1; generateStartPage(redirectToFirstScenarioPage); for (PageVisitor visitor : visitors) { allScenariosPageCollection.accept(visitor); } } @Inject  ReportGenerator(
            final FileIO fileIO,
            final TemplateEngine templateEngine,
            final PropertyManager propertyManager,
            final FileSystemManager fileSystemManager,
            final StartPageRenderer startPageRenderer,
            final CustomCssRenderer customCssRenderer,
            final VisitorDirectory visitorDirectory
    ); void generateReport(final AllScenariosPageCollection allScenariosPageCollection);  }
@Test public void fileOperationsTest() throws Exception { AllScenariosPageCollection allScenariosPageCollection = new AllScenariosPageCollection(""); Report report1 = new Report(); List<Element> elements1 = new ArrayList<>(); Element element1 = new Element(); elements1.add(element1); report1.setElements(elements1); Report report2 = new Report(); List<Element> elements2 = new ArrayList<>(); Element element2 = new Element(); elements2.add(element2); report2.setElements(elements2); Report[] reportList = {report1, report2}; allScenariosPageCollection.addReports(reportList); reportGenerator.generateReport(allScenariosPageCollection); verify(fileSystemManager, times(8)).createDirectory(anyString()); verify(fileSystemManager, times(17)).copyResourceFromJar(anyString(), anyString()); }