SubStepDefinitionParser { void parseSubStepFile(final File substepFile) { FileContents currentFileContents = FileContents.fromFile(substepFile); parseSubstepFileContents(currentFileContents); } SubStepDefinitionParser(final SyntaxErrorReporter syntaxErrorReporter);  SubStepDefinitionParser(final boolean failOnDuplicateSubsteps, final SyntaxErrorReporter syntaxErrorReporter); PatternMap<ParentStep> parseSubstepFileContents(FileContents currentFileContents); PatternMap<ParentStep> loadSubSteps(final File definitions);  }
@Test public void shouldReportEmptyDefinition() { this.parser = new SubStepDefinitionParser(DO_NOT_FAIL_ON_DUPLICATE_SUBSTEPS, this.errorReporter); this.parser.parseSubStepFile(new File( "./target/test-classes/com/technophobia/substeps/runner/syntax/empty-definition.substeps")); verify(this.errorReporter).reportSubstepsError(any(SubstepsParsingException.class)); }
@Test public void shouldReportDuplicateDefinition() { this.parser = new SubStepDefinitionParser(DO_NOT_FAIL_ON_DUPLICATE_SUBSTEPS, this.errorReporter); this.parser.parseSubStepFile(new File( "./target/test-classes/com/technophobia/substeps/runner/syntax/duplicate-definition.substeps")); verify(this.errorReporter).reportSubstepsError(any(SubstepsParsingException.class)); }