spring-framework / org.springframework.test.context.support / TestPropertySourceUtils / convertInlinedPropertiesToMap

convertInlinedPropertiesToMap

open static fun convertInlinedPropertiesToMap(vararg inlinedProperties: String): MutableMap<String, Any>

Convert the supplied inlined properties (in the form of key-value pairs) into a map keyed by property name, preserving the ordering of property names in the returned map.

Parsing of the key-value pairs is achieved by converting all pairs into virtual properties files in memory and delegating to Properties#load(java.io.Reader) to parse each virtual file.

For a full discussion of inlined properties, consult the Javadoc for TestPropertySource#properties.

Parameters

inlinedProperties - the inlined properties to convert; potentially empty but never null

Exceptions

IllegalStateException - if a given key-value pair cannot be parsed, or if a given inlined property contains multiple key-value pairs

Return
a new, ordered map containing the converted properties

Since
4.1.5

See Also
#addInlinedPropertiesToEnvironment(ConfigurableEnvironment, String[])