Search in sources :

Example 1 with BinaryScanStepRunner

use of com.synopsys.integration.detect.lifecycle.run.step.BinaryScanStepRunner in project synopsys-detect by blackducksoftware.

the class BinaryUploadOperationTest method testShouldFailOnDirectory.

@Test
public void testShouldFailOnDirectory() throws OperationException {
    BinaryScanOptions binaryScanOptions = new BinaryScanOptions(Paths.get("."), null, 0, false);
    OperationFactory operationFactory = Mockito.mock(OperationFactory.class);
    Mockito.when(operationFactory.calculateBinaryScanOptions()).thenReturn(binaryScanOptions);
    BinaryScanStepRunner binaryScanStepRunner = new BinaryScanStepRunner(operationFactory);
    Optional<File> result = binaryScanStepRunner.determineBinaryScanFileTarget(DockerTargetData.NO_DOCKER_TARGET);
    Mockito.verify(operationFactory).publishBinaryFailure(Mockito.anyString());
    Assertions.assertFalse(result.isPresent());
}
Also used : BinaryScanStepRunner(com.synopsys.integration.detect.lifecycle.run.step.BinaryScanStepRunner) File(java.io.File) OperationFactory(com.synopsys.integration.detect.lifecycle.run.operation.OperationFactory) Test(org.junit.jupiter.api.Test)

Aggregations

OperationFactory (com.synopsys.integration.detect.lifecycle.run.operation.OperationFactory)1 BinaryScanStepRunner (com.synopsys.integration.detect.lifecycle.run.step.BinaryScanStepRunner)1 File (java.io.File)1 Test (org.junit.jupiter.api.Test)1