Search in sources :

Example 1 with ToolPoetrySectionParser

use of com.synopsys.integration.detectable.detectables.poetry.parser.ToolPoetrySectionParser in project synopsys-detect by blackducksoftware.

the class PoetryFalsePositiveTest method testApplicableNoFalsePositive.

@Test
public void testApplicableNoFalsePositive() throws URISyntaxException {
    FileFinder fileFinder = Mockito.mock(SimpleFileFinder.class);
    File currentDirectory = new File(System.getProperty("user.dir"));
    File pyprojectToml = new File(getClass().getClassLoader().getResource("detectables/unit/pip/poetry/false_positive_pyproject.toml").toURI());
    Mockito.when(fileFinder.findFile(currentDirectory, "pyproject.toml")).thenReturn(pyprojectToml);
    PoetryDetectable poetryDetectable = new PoetryDetectable(new DetectableEnvironment(currentDirectory), fileFinder, new PoetryExtractor(new PoetryLockParser()), new ToolPoetrySectionParser());
    Assertions.assertFalse(poetryDetectable.applicable().getPassed());
}
Also used : PoetryExtractor(com.synopsys.integration.detectable.detectables.poetry.PoetryExtractor) PoetryDetectable(com.synopsys.integration.detectable.detectables.poetry.PoetryDetectable) PoetryLockParser(com.synopsys.integration.detectable.detectables.poetry.parser.PoetryLockParser) FileFinder(com.synopsys.integration.common.util.finder.FileFinder) SimpleFileFinder(com.synopsys.integration.common.util.finder.SimpleFileFinder) ToolPoetrySectionParser(com.synopsys.integration.detectable.detectables.poetry.parser.ToolPoetrySectionParser) File(java.io.File) DetectableEnvironment(com.synopsys.integration.detectable.DetectableEnvironment) Test(org.junit.jupiter.api.Test)

Aggregations

FileFinder (com.synopsys.integration.common.util.finder.FileFinder)1 SimpleFileFinder (com.synopsys.integration.common.util.finder.SimpleFileFinder)1 DetectableEnvironment (com.synopsys.integration.detectable.DetectableEnvironment)1 PoetryDetectable (com.synopsys.integration.detectable.detectables.poetry.PoetryDetectable)1 PoetryExtractor (com.synopsys.integration.detectable.detectables.poetry.PoetryExtractor)1 PoetryLockParser (com.synopsys.integration.detectable.detectables.poetry.parser.PoetryLockParser)1 ToolPoetrySectionParser (com.synopsys.integration.detectable.detectables.poetry.parser.ToolPoetrySectionParser)1 File (java.io.File)1 Test (org.junit.jupiter.api.Test)1