use of com.synopsys.integration.configuration.config.PropertyConfiguration in project synopsys-detect by blackducksoftware.
the class ShutdownDeciderTest method shouldPreserveScanIfDryRun.
@Test
public void shouldPreserveScanIfDryRun() {
PropertyConfiguration configuration = ConfigTestUtils.configOf(Pair.of(DetectProperties.DETECT_BLACKDUCK_SIGNATURE_SCANNER_DRY_RUN.getKey(), "true"));
CleanupDecision decision = new ShutdownDecider().decideCleanup(configuration, null, null);
assertTrue(decision.shouldPreserveScan());
}
use of com.synopsys.integration.configuration.config.PropertyConfiguration in project synopsys-detect by blackducksoftware.
the class ShutdownDeciderTest method shouldSkipCleanupIfProvidedFalse.
@Test
public void shouldSkipCleanupIfProvidedFalse() {
PropertyConfiguration configuration = ConfigTestUtils.configOf(Pair.of(DetectProperties.DETECT_CLEANUP.getKey(), "false"));
CleanupDecision decision = new ShutdownDecider().decideCleanup(configuration, null, null);
assertFalse(decision.shouldCleanup());
}
use of com.synopsys.integration.configuration.config.PropertyConfiguration in project synopsys-detect by blackducksoftware.
the class DiagnosticDecisionTest method commandLineDecision.
@Test
void commandLineDecision() {
PropertyConfiguration propertyConfiguration = createPropertyConfiguration(false, false);
DetectArgumentState detectArgumentState = createDetectArgumentState(true, false);
DiagnosticDecision diagnosticDecision = DiagnosticDecision.decide(detectArgumentState, propertyConfiguration);
Assertions.assertTrue(diagnosticDecision.shouldCreateDiagnosticSystem());
Assertions.assertFalse(diagnosticDecision.isExtended());
}
use of com.synopsys.integration.configuration.config.PropertyConfiguration in project synopsys-detect by blackducksoftware.
the class DiagnosticDecisionTest method noDiagnostic.
@Test
void noDiagnostic() {
PropertyConfiguration propertyConfiguration = createPropertyConfiguration(false, false);
DetectArgumentState detectArgumentState = createDetectArgumentState(false, false);
DiagnosticDecision diagnosticDecision = DiagnosticDecision.decide(detectArgumentState, propertyConfiguration);
Assertions.assertFalse(diagnosticDecision.shouldCreateDiagnosticSystem());
Assertions.assertFalse(diagnosticDecision.isExtended());
}
use of com.synopsys.integration.configuration.config.PropertyConfiguration in project synopsys-detect by blackducksoftware.
the class DiagnosticDecisionTest method createPropertyConfiguration.
private PropertyConfiguration createPropertyConfiguration(boolean isDiagnostic, boolean isExtended) {
HashMap<String, String> propertySourceMap = new HashMap<>();
propertySourceMap.put(DetectProperties.DETECT_DIAGNOSTIC.getKey(), String.valueOf(isDiagnostic));
propertySourceMap.put(DetectProperties.DETECT_DIAGNOSTIC_EXTENDED.getKey(), String.valueOf(isExtended));
MapPropertySource mapPropertySource = new MapPropertySource(TEST_PROPERTY_SOURCE_NAME, propertySourceMap);
return new PropertyConfiguration(Collections.singletonList(mapPropertySource));
}
Aggregations