Search in sources :

Example 1 with NpmCliExtractor

use of com.synopsys.integration.detectable.detectables.npm.cli.NpmCliExtractor in project synopsys-detect by blackducksoftware.

the class DetectableFactory method createNpmCliDetectable.

public NpmCliDetectable createNpmCliDetectable(DetectableEnvironment environment, NpmResolver npmResolver, NpmCliExtractorOptions npmCliExtractorOptions) {
    NpmCliParser npmCliParser = new NpmCliParser(externalIdFactory, npmCliExtractorOptions.getDependencyTypeFilter());
    NpmCliExtractor npmCliExtractor = new NpmCliExtractor(executableRunner, npmCliParser, gson, toolVersionLogger);
    return new NpmCliDetectable(environment, fileFinder, npmResolver, npmCliExtractor, npmCliExtractorOptions);
}
Also used : NpmCliExtractor(com.synopsys.integration.detectable.detectables.npm.cli.NpmCliExtractor) NpmCliDetectable(com.synopsys.integration.detectable.detectables.npm.cli.NpmCliDetectable) NpmCliParser(com.synopsys.integration.detectable.detectables.npm.cli.parse.NpmCliParser)

Example 2 with NpmCliExtractor

use of com.synopsys.integration.detectable.detectables.npm.cli.NpmCliExtractor in project synopsys-detect by blackducksoftware.

the class NpmCliDetectableTest method testApplicable.

@Test
public void testApplicable() {
    NpmResolver npmResolver = null;
    NpmCliExtractor npmCliExtractor = null;
    DetectableEnvironment environment = MockDetectableEnvironment.empty();
    FileFinder fileFinder = MockFileFinder.withFileNamed("package.json");
    NpmCliDetectable detectable = new NpmCliDetectable(environment, fileFinder, npmResolver, npmCliExtractor, new NpmCliExtractorOptions(EnumListFilter.fromExcluded(NpmDependencyType.DEV, NpmDependencyType.PEER), ""));
    assertTrue(detectable.applicable().getPassed());
}
Also used : NpmCliExtractorOptions(com.synopsys.integration.detectable.detectables.npm.cli.NpmCliExtractorOptions) NpmResolver(com.synopsys.integration.detectable.detectable.executable.resolver.NpmResolver) NpmCliExtractor(com.synopsys.integration.detectable.detectables.npm.cli.NpmCliExtractor) NpmCliDetectable(com.synopsys.integration.detectable.detectables.npm.cli.NpmCliDetectable) MockFileFinder(com.synopsys.integration.detectable.util.MockFileFinder) FileFinder(com.synopsys.integration.common.util.finder.FileFinder) DetectableEnvironment(com.synopsys.integration.detectable.DetectableEnvironment) MockDetectableEnvironment(com.synopsys.integration.detectable.util.MockDetectableEnvironment) Test(org.junit.jupiter.api.Test)

Aggregations

NpmCliDetectable (com.synopsys.integration.detectable.detectables.npm.cli.NpmCliDetectable)2 NpmCliExtractor (com.synopsys.integration.detectable.detectables.npm.cli.NpmCliExtractor)2 FileFinder (com.synopsys.integration.common.util.finder.FileFinder)1 DetectableEnvironment (com.synopsys.integration.detectable.DetectableEnvironment)1 NpmResolver (com.synopsys.integration.detectable.detectable.executable.resolver.NpmResolver)1 NpmCliExtractorOptions (com.synopsys.integration.detectable.detectables.npm.cli.NpmCliExtractorOptions)1 NpmCliParser (com.synopsys.integration.detectable.detectables.npm.cli.parse.NpmCliParser)1 MockDetectableEnvironment (com.synopsys.integration.detectable.util.MockDetectableEnvironment)1 MockFileFinder (com.synopsys.integration.detectable.util.MockFileFinder)1 Test (org.junit.jupiter.api.Test)1