Search in sources :

Example 1 with ComposerLockExtractor

use of com.synopsys.integration.detectable.detectables.packagist.ComposerLockExtractor in project synopsys-detect by blackducksoftware.

the class DetectableFactory method createComposerDetectable.

public ComposerLockDetectable createComposerDetectable(DetectableEnvironment environment, ComposerLockDetectableOptions composerLockDetectableOptions) {
    PackagistParser packagistParser = new PackagistParser(externalIdFactory, composerLockDetectableOptions.getDependencyTypeFilter());
    ComposerLockExtractor composerLockExtractor = new ComposerLockExtractor(packagistParser);
    return new ComposerLockDetectable(environment, fileFinder, composerLockExtractor);
}
Also used : PackagistParser(com.synopsys.integration.detectable.detectables.packagist.parse.PackagistParser) ComposerLockExtractor(com.synopsys.integration.detectable.detectables.packagist.ComposerLockExtractor) ComposerLockDetectable(com.synopsys.integration.detectable.detectables.packagist.ComposerLockDetectable)

Example 2 with ComposerLockExtractor

use of com.synopsys.integration.detectable.detectables.packagist.ComposerLockExtractor in project synopsys-detect by blackducksoftware.

the class ComposerLockDetectableTest method testApplicable.

@Test
public void testApplicable() {
    ComposerLockExtractor composerLockExtractor = null;
    DetectableEnvironment environment = MockDetectableEnvironment.empty();
    FileFinder fileFinder = MockFileFinder.withFilesNamed("composer.lock", "composer.json");
    ComposerLockDetectable detectable = new ComposerLockDetectable(environment, fileFinder, composerLockExtractor);
    assertTrue(detectable.applicable().getPassed());
}
Also used : MockFileFinder(com.synopsys.integration.detectable.util.MockFileFinder) FileFinder(com.synopsys.integration.common.util.finder.FileFinder) ComposerLockExtractor(com.synopsys.integration.detectable.detectables.packagist.ComposerLockExtractor) DetectableEnvironment(com.synopsys.integration.detectable.DetectableEnvironment) MockDetectableEnvironment(com.synopsys.integration.detectable.util.MockDetectableEnvironment) ComposerLockDetectable(com.synopsys.integration.detectable.detectables.packagist.ComposerLockDetectable) Test(org.junit.jupiter.api.Test)

Aggregations

ComposerLockDetectable (com.synopsys.integration.detectable.detectables.packagist.ComposerLockDetectable)2 ComposerLockExtractor (com.synopsys.integration.detectable.detectables.packagist.ComposerLockExtractor)2 FileFinder (com.synopsys.integration.common.util.finder.FileFinder)1 DetectableEnvironment (com.synopsys.integration.detectable.DetectableEnvironment)1 PackagistParser (com.synopsys.integration.detectable.detectables.packagist.parse.PackagistParser)1 MockDetectableEnvironment (com.synopsys.integration.detectable.util.MockDetectableEnvironment)1 MockFileFinder (com.synopsys.integration.detectable.util.MockFileFinder)1 Test (org.junit.jupiter.api.Test)1