dependency-check-cli/src/test/java/org/owasp/dependencycheck/AppTest.java
/**
     * Assert that multiple suppression files can be set using the CLI.
     *
     * @throws Exception the unexpected {@link Exception}.
     */
Assert that multiple suppression files can be set using the CLI.
@throws Exception the unexpected  Exception.
Assert that multiple suppression files can be set using the CLI . @throws Exception the unexpected Exception .
@Test
    public void testPopulatingSuppressionSettingsWithMultipleFiles() throws Exception {
        File prop = new File(this.getClass().getClassLoader().getResource("sample.properties").toURI().getPath());
        String[] args = {"-P", prop.getAbsolutePath(), "--suppression", "first-file.xml", "another-file.xml"};
        final CliParser cli = new CliParser();
        cli.parse(args);
        final App classUnderTest = new App();
        classUnderTest.populateSettings(cli);
        assertThat("Expected the suppression files to be set in the Settings singleton with a separator", Settings.getString(KEYS.SUPPRESSION_FILE), is("first-file.xml,another-file.xml"));
    }
@ Test public void testPopulatingSuppressionSettingsWithMultipleFiles ( ) throws Exception { File prop = new File ( this . getClass ( ) . getClassLoader ( ) . getResource ( "sample.properties" ) . toURI ( ) . getPath ( ) ) ; String [ ] args = { "-P" , prop . getAbsolutePath ( ) , "--suppression" , "first-file.xml" , "another-file.xml" } ; final CliParser cli = new CliParser ( ) ; cli . parse ( args ) ; final App classUnderTest = new App ( ) ; classUnderTest . populateSettings ( cli ) ; assertThat ( "Expected the suppression files to be set in the Settings singleton with a separator" , Settings . getString ( KEYS . SUPPRESSION_FILE ) , is ( "first-file.xml,another-file.xml" ) ) ; }
Assert that multiple suppression files can be set using the CLI.
Assert that multiple suppression files can be set using the CLI .
// GIVEN CLI properties with the mandatory arguments // AND a single suppression file // WHEN parsing the CLI arguments // THEN the suppression file is set in the settings singleton for use in the application core