CliArguments { public void setOutputFile(final String outputFile) { this.outputFile = Paths.get(outputFile); } CliArguments(final DirectoryService directoryService); Path getOutputPath(); void setOutputFile(final String outputFile); void setF(final String outputFile); Optional<String> getCommand(); List<String> getInputs(); void setUnnamedValues(final List<String> unnamedValues); String getOutputFormat(); void setOutputFormat(final String outputFormat); void setO(final String outputFormat); ReportVerbosity getReportVerbosity(); void setReportVerbosity(final ReportVerbosity reportVerbosity); void setV(final ReportVerbosity reportVerbosity); Newline getNewline(); void setNewline(final Newline newline); void setN(final Newline newline); Set<String> getWantedArtifactTypes(); void setWantedArtifactTypes(final String artifactTypes); void setA(final String artifactTypes); Set<String> getWantedTags(); void setWantedTags(final String tags); void setT(final String tags); boolean getShowOrigin(); void setShowOrigin(final boolean showOrigin); void setS(final boolean showOrigin); static final String NO_TAGS_MARKER; }
@Test void testSetOutputFile() { final String value = "/tmp/foobar"; final String expectedPath = Paths.get(value).toString(); assertThat(BEFORE_SETTER, this.arguments.getOutputPath(), equalTo(null)); this.arguments.setOutputFile(value); assertThat(AFTER_SETTER, this.arguments.getOutputPath().toString(), equalTo(expectedPath)); }