diff --git a/src/test/groovy/ApmCliStepTests.groovy b/src/test/groovy/ApmCliStepTests.groovy index 320d7323d..352c8b2b7 100644 --- a/src/test/groovy/ApmCliStepTests.groovy +++ b/src/test/groovy/ApmCliStepTests.groovy @@ -86,11 +86,8 @@ class ApmCliStepTests extends ApmBasePipelineTest { @Test void testVaultConfig() throws Exception { helper.registerAllowedMethod('getVaultSecret', [Map.class], - { return [ - "data": [ - "value": '{"url": "https://vaultapm.example.com:8200", "token": "vaultApmPassword"}' - ] - ] + { + return [data: [value: '{"url": "https://vaultapm.example.com:8200", "token": "vaultApmPassword"}' ]] }) script.call(apmCliConfig: "secret/oblt/apm", serviceName: "serviceFoo") diff --git a/vars/apmCli.groovy b/vars/apmCli.groovy index eaeed92b3..7f542b061 100644 --- a/vars/apmCli.groovy +++ b/vars/apmCli.groovy @@ -53,7 +53,7 @@ def call(Map args = [:]) { if(!url && !token){ def apmJson = getVaultSecret(secret: "${apmCliConfig}")?.data.value - def apm = readJSON(text: apmJson) + def apm = toJSON(apmJson) url = apm.url token = apm.token }