Search in sources :

Example 1 with BazelDetectableOptions

use of com.synopsys.integration.detectable.detectables.bazel.BazelDetectableOptions in project synopsys-detect by blackducksoftware.

the class BazelDetectableTest method testApplicable.

@Test
public void testApplicable() {
    DetectableEnvironment environment = MockDetectableEnvironment.empty();
    FileFinder fileFinder = Mockito.mock(FileFinder.class);
    Mockito.when(fileFinder.findFile(new File("."), "WORKSPACE")).thenReturn(new File("src/test/resources/functional/bazel/WORKSPACE"));
    BazelExtractor bazelExtractor = null;
    BazelResolver bazelResolver = null;
    BazelDetectableOptions bazelDetectableOptions = new BazelDetectableOptions("target", null, null);
    BazelDetectable detectable = new BazelDetectable(environment, fileFinder, bazelExtractor, bazelResolver, bazelDetectableOptions.getTargetName().orElse(null));
    assertTrue(detectable.applicable().getPassed());
}
Also used : BazelExtractor(com.synopsys.integration.detectable.detectables.bazel.BazelExtractor) BazelDetectableOptions(com.synopsys.integration.detectable.detectables.bazel.BazelDetectableOptions) BazelDetectable(com.synopsys.integration.detectable.detectables.bazel.BazelDetectable) BazelResolver(com.synopsys.integration.detectable.detectable.executable.resolver.BazelResolver) FileFinder(com.synopsys.integration.common.util.finder.FileFinder) File(java.io.File) DetectableEnvironment(com.synopsys.integration.detectable.DetectableEnvironment) MockDetectableEnvironment(com.synopsys.integration.detectable.util.MockDetectableEnvironment) Test(org.junit.jupiter.api.Test)

Aggregations

FileFinder (com.synopsys.integration.common.util.finder.FileFinder)1 DetectableEnvironment (com.synopsys.integration.detectable.DetectableEnvironment)1 BazelResolver (com.synopsys.integration.detectable.detectable.executable.resolver.BazelResolver)1 BazelDetectable (com.synopsys.integration.detectable.detectables.bazel.BazelDetectable)1 BazelDetectableOptions (com.synopsys.integration.detectable.detectables.bazel.BazelDetectableOptions)1 BazelExtractor (com.synopsys.integration.detectable.detectables.bazel.BazelExtractor)1 MockDetectableEnvironment (com.synopsys.integration.detectable.util.MockDetectableEnvironment)1 File (java.io.File)1 Test (org.junit.jupiter.api.Test)1