Search in sources :

Example 16 with PropertySource

use of com.synopsys.integration.configuration.source.PropertySource in project synopsys-detect by blackducksoftware.

the class PropertyConfigurationTest method getRawPassthroughMultipleValues.

@Test
public void getRawPassthroughMultipleValues() {
    PassthroughProperty passthrough = new PassthroughProperty("pass");
    PropertySource secondarySource = propertySourceOf("secondary", Pair.of("pass.two", "two value"), Pair.of("ignore", "ignore value"));
    PropertySource primarySource = propertySourceOf("primary", Pair.of("pass.one", "one value"));
    PropertyConfiguration configuration = configOf(primarySource, secondarySource);
    Map<String, String> properties = Bds.mapOf(Pair.of("one", "one value"), Pair.of("two", "two value"));
    Assertions.assertEquals(properties, configuration.getRaw(passthrough));
}
Also used : PassthroughProperty(com.synopsys.integration.configuration.property.base.PassthroughProperty) PropertySource(com.synopsys.integration.configuration.source.PropertySource) Test(org.junit.jupiter.api.Test)

Aggregations

PropertySource (com.synopsys.integration.configuration.source.PropertySource)16 Test (org.junit.jupiter.api.Test)12 MapPropertySource (com.synopsys.integration.configuration.source.MapPropertySource)7 ArrayList (java.util.ArrayList)6 PropertyConfiguration (com.synopsys.integration.configuration.config.PropertyConfiguration)5 NullableStringProperty (com.synopsys.integration.configuration.property.types.string.NullableStringProperty)5 SimplePathResolver (com.synopsys.integration.configuration.property.types.path.SimplePathResolver)4 Gson (com.google.gson.Gson)3 HashMap (java.util.HashMap)3 PassthroughProperty (com.synopsys.integration.configuration.property.base.PassthroughProperty)2 SpringConfigurationPropertySource (com.synopsys.integration.configuration.source.SpringConfigurationPropertySource)2 BdioOptions (com.synopsys.integration.detect.workflow.bdio.BdioOptions)2 BlackDuckServerConfig (com.synopsys.integration.blackduck.configuration.BlackDuckServerConfig)1 NoPropertyResolution (com.synopsys.integration.configuration.config.resolution.NoPropertyResolution)1 PropertyResolutionInfo (com.synopsys.integration.configuration.config.resolution.PropertyResolutionInfo)1 SourcePropertyResolution (com.synopsys.integration.configuration.config.resolution.SourcePropertyResolution)1 DetectConfigurationFactory (com.synopsys.integration.detect.configuration.DetectConfigurationFactory)1 DetectPropertyConfiguration (com.synopsys.integration.detect.configuration.DetectPropertyConfiguration)1 BlackDuckConfigFactory (com.synopsys.integration.detect.configuration.connection.BlackDuckConfigFactory)1 DetectArgumentState (com.synopsys.integration.detect.configuration.help.DetectArgumentState)1