StepVisitor implements PageVisitor { @Override public void visit(final AllScenariosPageCollection allScenariosPageCollection) throws CluecumberPluginException { AllStepsPageCollection allStepsPageCollection = new AllStepsPageCollection( allScenariosPageCollection.getReports(), propertyManager.getCustomPageTitle() ); fileIO.writeContentToFile( allStepsPageRenderer.getRenderedContent( allStepsPageCollection, templateEngine.getTemplate(ALL_STEPS) ), propertyManager.getGeneratedHtmlReportDirectory() + "/" + PluginSettings.PAGES_DIRECTORY + "/" + PluginSettings.STEP_SUMMARY_PAGE_PATH + PluginSettings.HTML_FILE_EXTENSION); for (Step step : allStepsPageCollection.getSteps()) { fileIO.writeContentToFile( allScenariosPageRenderer.getRenderedContentByStepFilter( allScenariosPageCollection, templateEngine.getTemplate(ALL_SCENARIOS), step), propertyManager.getGeneratedHtmlReportDirectory() + "/" + PluginSettings.PAGES_DIRECTORY + PluginSettings.STEP_SCENARIO_PAGE_FRAGMENT + step.getUrlFriendlyName() + PluginSettings.HTML_FILE_EXTENSION); } } @Inject  StepVisitor(
            final FileIO fileIO,
            final TemplateEngine templateEngine,
            final PropertyManager propertyManager,
            final AllStepsPageRenderer allStepsPageRenderer,
            final AllScenariosPageRenderer allScenariosPageRenderer
    ); @Override void visit(final AllScenariosPageCollection allScenariosPageCollection);  }
@Test public void visitTest() throws CluecumberPluginException { when(allStepsPageRenderer.getRenderedContent(any(), any())).thenReturn("MyRenderedSteps"); when(allScenariosPageRenderer.getRenderedContentByStepFilter(any(), any(), any())).thenReturn("MyRenderedScenarios"); stepVisitor.visit(getAllScenarioPageCollection()); verify(fileIo, times(1)) .writeContentToFile("MyRenderedSteps", "dummyPath/pages/step-summary.html"); verify(fileIo, times(1)) .writeContentToFile("MyRenderedScenarios", "dummyPath/pages/step-scenarios/step_31.html"); }