Package com.funnelback.mock.helpers
Class MapBackedConfig
- java.lang.Object
-
- com.funnelback.mock.helpers.MapBackedConfig
-
public class MapBackedConfig extends Object
Internal class, not to be used directly.
-
-
Field Summary
Fields Modifier and Type Field Description private Map<String,String>
configSettings
This can be used to mock setting values in collection.cfg.
-
Constructor Summary
Constructors Constructor Description MapBackedConfig()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private Optional<List<String>>
configKeyMatches(String pattern, String escapedKeyWithParameters)
Copied from common WildCardKeyMatcherprivate Map<String,List<String>>
getAllKeysMatchingPattern(String pattern, Collection<String> hayStack)
Copied and modified from WildCardKeyMatcher, this does not deal woth config envoronments.Set<String>
getConfigKeys()
Map<String,List<String>>
getConfigKeysMatchingPattern(String pattern)
Set<String>
getConfigKeysWithPrefix(String prefix)
String
getConfigSetting(String key)
void
setConfigSetting(String key, String value)
Set a config setting to a value.
-
-
-
Field Detail
-
configSettings
private Map<String,String> configSettings
This can be used to mock setting values in collection.cfg. Must not contain environment prefixed keys, no key should start with 'env.' Variable expansion will not be done e.g. $SEARCH_HOME will not be expanded. In test set the values to exactly what you expect them to be.
-
-
Method Detail
-
setConfigSetting
public void setConfigSetting(String key, String value)
Set a config setting to a value.- Parameters:
key
-value
- The value to set the key to, when null the key will be removed from the config settings.
-
getConfigKeysMatchingPattern
public Map<String,List<String>> getConfigKeysMatchingPattern(String pattern)
-
configKeyMatches
private Optional<List<String>> configKeyMatches(String pattern, String escapedKeyWithParameters) throws IllegalArgumentException
Copied from common WildCardKeyMatcher- Parameters:
pattern
-escapedKeyWithParameters
-- Returns:
- Throws:
IllegalArgumentException
-
-