use of com.synopsys.integration.detectable.detectables.docker.DockerDetectableOptions in project synopsys-detect by blackducksoftware.
the class DetectableOptionFactory method createDockerDetectableOptions.
public DockerDetectableOptions createDockerDetectableOptions() {
Boolean dockerPathRequired = detectConfiguration.getValue(DetectProperties.DETECT_DOCKER_PATH_REQUIRED);
String suppliedDockerImage = detectConfiguration.getNullableValue(DetectProperties.DETECT_DOCKER_IMAGE);
String dockerImageId = detectConfiguration.getNullableValue(DetectProperties.DETECT_DOCKER_IMAGE_ID);
String suppliedDockerTar = detectConfiguration.getNullableValue(DetectProperties.DETECT_DOCKER_TAR);
LogLevel dockerInspectorLoggingLevel;
if (detectConfiguration.wasPropertyProvided(DetectProperties.LOGGING_LEVEL_DETECT)) {
dockerInspectorLoggingLevel = detectConfiguration.getValue(DetectProperties.LOGGING_LEVEL_DETECT);
} else {
dockerInspectorLoggingLevel = detectConfiguration.getValue(DetectProperties.LOGGING_LEVEL_COM_SYNOPSYS_INTEGRATION);
}
String dockerInspectorVersion = detectConfiguration.getNullableValue(DetectProperties.DETECT_DOCKER_INSPECTOR_VERSION);
Map<String, String> additionalDockerProperties = detectConfiguration.getRaw(DetectProperties.DOCKER_PASSTHROUGH);
if (diagnosticSystem != null) {
additionalDockerProperties.putAll(diagnosticSystem.getAdditionalDockerProperties());
}
Path dockerInspectorPath = detectConfiguration.getPathOrNull(DetectProperties.DETECT_DOCKER_INSPECTOR_PATH);
String dockerPlatformTopLayerId = detectConfiguration.getNullableValue(DetectProperties.DETECT_DOCKER_PLATFORM_TOP_LAYER_ID);
return new DockerDetectableOptions(dockerPathRequired, suppliedDockerImage, dockerImageId, suppliedDockerTar, dockerInspectorLoggingLevel, dockerInspectorVersion, additionalDockerProperties, dockerInspectorPath, dockerPlatformTopLayerId);
}
use of com.synopsys.integration.detectable.detectables.docker.DockerDetectableOptions in project synopsys-detect by blackducksoftware.
the class DockerDetectableTest method testApplicable.
@Test
public void testApplicable() {
DetectableEnvironment environment = null;
DockerInspectorResolver dockerInspectorResolver = null;
JavaResolver javaResolver = null;
DockerResolver dockerResolver = null;
DockerExtractor dockerExtractor = null;
DockerDetectableOptions dockerDetectableOptions = Mockito.mock(DockerDetectableOptions.class);
Mockito.when(dockerDetectableOptions.hasDockerImageOrTar()).thenReturn(Boolean.TRUE);
DockerDetectable detectable = new DockerDetectable(environment, dockerInspectorResolver, javaResolver, dockerResolver, dockerExtractor, dockerDetectableOptions);
DetectableResult result = detectable.applicable();
assertTrue(result.getPassed() || result instanceof WrongOperatingSystemResult);
}
Aggregations