mirror of
https://github.com/SAP/jenkins-library.git
synced 2024-12-14 11:03:09 +02:00
rename method
This commit is contained in:
parent
88d09eee63
commit
edf3deaa9c
@ -39,10 +39,13 @@ class ConfigurationMerger {
|
||||
}
|
||||
|
||||
@NonCPS
|
||||
def static mergeDeepStructure(Map parameters, Map parameterKeys, Map configuration, Map configurationKeys, Map defaults=[:]){
|
||||
Map merged = [:]
|
||||
merged.putAll(defaults)
|
||||
merged = merge(configuration, configurationKeys, merged)
|
||||
def static merge(
|
||||
Map parameters, Map parameterKeys,
|
||||
Map configuration, Map configurationKeys,
|
||||
Map defaults=[:]
|
||||
){
|
||||
Map merged
|
||||
merged = merge(configuration, configurationKeys, defaults)
|
||||
merged = merge(parameters, parameterKeys, merged)
|
||||
return merged
|
||||
}
|
||||
|
@ -47,7 +47,7 @@ class ConfigurationMergerTest {
|
||||
Map configurationKeys = [fruits: [apples: null, oranges: null, bananaaas: null]]
|
||||
Map parameters = [fruits: [apples: 18]]
|
||||
Map parameterKeys = [fruits: [apples: null, oranges: null, bananaaas: null]]
|
||||
Map merged = ConfigurationMerger.mergeDeepStructure(parameters, parameterKeys, configuration, configurationKeys, defaults)
|
||||
Map merged = ConfigurationMerger.merge(parameters, parameterKeys, configuration, configurationKeys, defaults)
|
||||
Assert.assertEquals(50, merged.fruits.bananaaas)
|
||||
Assert.assertEquals(18, merged.fruits.apples)
|
||||
Assert.assertEquals(10, merged.fruits.oranges)
|
||||
|
Loading…
Reference in New Issue
Block a user