use of com.synopsys.integration.configuration.config.PropertyConfiguration in project synopsys-detect by blackducksoftware.
the class DiagnosticDecisionTest method commandLineDecisionExtended.
@Test
void commandLineDecisionExtended() {
PropertyConfiguration propertyConfiguration = createPropertyConfiguration(false, false);
DetectArgumentState detectArgumentState = createDetectArgumentState(false, true);
DiagnosticDecision diagnosticDecision = DiagnosticDecision.decide(detectArgumentState, propertyConfiguration);
Assertions.assertTrue(diagnosticDecision.shouldCreateDiagnosticSystem());
Assertions.assertTrue(diagnosticDecision.isExtended());
}
use of com.synopsys.integration.configuration.config.PropertyConfiguration in project synopsys-detect by blackducksoftware.
the class DiagnosticDecisionTest method propertyDecision.
@Test
void propertyDecision() {
PropertyConfiguration propertyConfiguration = createPropertyConfiguration(true, false);
DetectArgumentState detectArgumentState = createDetectArgumentState(false, 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 propertyDecisionExtended.
@Test
void propertyDecisionExtended() {
PropertyConfiguration propertyConfiguration = createPropertyConfiguration(false, true);
DetectArgumentState detectArgumentState = createDetectArgumentState(false, false);
DiagnosticDecision diagnosticDecision = DiagnosticDecision.decide(detectArgumentState, propertyConfiguration);
Assertions.assertTrue(diagnosticDecision.shouldCreateDiagnosticSystem());
Assertions.assertTrue(diagnosticDecision.isExtended());
}
use of com.synopsys.integration.configuration.config.PropertyConfiguration in project synopsys-detect by blackducksoftware.
the class DetectConfigurationFactoryTestUtils method factoryOf.
@SafeVarargs
public static DetectConfigurationFactory factoryOf(Pair<Property, String>... properties) {
Map<String, String> propertyMap = Bds.of(properties).toMap(pair -> pair.getLeft().getKey(), Pair::getRight);
PropertySource inMemoryPropertySource = new MapPropertySource("test", propertyMap);
PropertyConfiguration propertyConfiguration = new PropertyConfiguration(Collections.singletonList(inMemoryPropertySource));
DetectPropertyConfiguration detectPropertyConfiguration = new DetectPropertyConfiguration(propertyConfiguration, new SimplePathResolver());
return new DetectConfigurationFactory(detectPropertyConfiguration, new Gson());
}
use of com.synopsys.integration.configuration.config.PropertyConfiguration in project synopsys-detect by blackducksoftware.
the class DetectConfigurationTest method testGenericProperty.
@Test
public void testGenericProperty() {
HashMap<String, String> values = new HashMap<>();
values.put(DetectProperties.DETECT_PROJECT_CODELOCATION_PREFIX.getKey(), "some_prefix");
List<PropertySource> propertySources = new ArrayList<>();
propertySources.add(new MapPropertySource("test", values));
PropertyConfiguration propertyConfiguration = new PropertyConfiguration(propertySources);
DetectPropertyConfiguration detectPropertyConfiguration = new DetectPropertyConfiguration(propertyConfiguration, new SimplePathResolver());
DetectConfigurationFactory detectConfigurationFactory = new DetectConfigurationFactory(detectPropertyConfiguration, new Gson());
BdioOptions bdioOptions = detectConfigurationFactory.createBdioOptions();
assertTrue(bdioOptions.getProjectCodeLocationPrefix().isPresent());
assertEquals("some_prefix", bdioOptions.getProjectCodeLocationPrefix().get());
}
Aggregations