Skip to content

Commit

Permalink
fix(webhook-task): replace deprecated method for json parsing (#3026)
Browse files Browse the repository at this point in the history
  • Loading branch information
gomid authored and marchello2000 committed Jul 8, 2019
1 parent 3b60ca7 commit 752aaf4
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import com.fasterxml.jackson.databind.JsonMappingException
import com.fasterxml.jackson.databind.ObjectMapper
import com.jayway.jsonpath.JsonPath
import com.jayway.jsonpath.PathNotFoundException
import com.jayway.jsonpath.internal.JsonContext
import com.netflix.spinnaker.orca.ExecutionStatus
import com.netflix.spinnaker.orca.RetryableTask
import com.netflix.spinnaker.orca.TaskResult
Expand Down Expand Up @@ -157,7 +156,7 @@ class CreateWebhookTask implements RetryableTask {
}
if (stage.context.containsKey("expectedArtifacts") && !((List) stage.context.get("expectedArtifacts")).isEmpty()) {
try {
def artifacts = new JsonContext().parse(response.body).read("artifacts")
def artifacts = JsonPath.parse(response.body).read("artifacts")
outputs << [artifacts: artifacts]
} catch (Exception e) {
outputs.webhook << [error: "Expected artifacts in webhook response none were found"]
Expand Down

0 comments on commit 752aaf4

Please sign in to comment.