1
0
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:
Christopher Fenner 2018-02-05 20:31:30 +01:00
parent 88d09eee63
commit edf3deaa9c
2 changed files with 8 additions and 5 deletions

View File

@ -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
}

View File

@ -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)