From 9e31a06793655958e1cc377bcab97cc9794d5495 Mon Sep 17 00:00:00 2001 From: Nikita Tkachenko Date: Thu, 16 May 2024 14:05:07 +0200 Subject: [PATCH] Fix build stub to not fail when getBuiltOn() is called in absence of Jenkins --- .../datadog/jenkins/plugins/datadog/stubs/BuildStub.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/test/java/org/datadog/jenkins/plugins/datadog/stubs/BuildStub.java b/src/test/java/org/datadog/jenkins/plugins/datadog/stubs/BuildStub.java index e1d0b99d..a8cdaaac 100644 --- a/src/test/java/org/datadog/jenkins/plugins/datadog/stubs/BuildStub.java +++ b/src/test/java/org/datadog/jenkins/plugins/datadog/stubs/BuildStub.java @@ -2,6 +2,7 @@ import hudson.EnvVars; import hudson.model.Build; +import hudson.model.Node; import hudson.model.Result; import hudson.model.TaskListener; import java.io.IOException; @@ -31,6 +32,11 @@ public BuildStub(@Nonnull ProjectStub project, Result result, EnvVars envVars, B this.previousNotFailedBuild = previousNotFailedBuild; } + @Override + public Node getBuiltOn() { + return null; + } + protected BuildStub(@Nonnull ProjectStub project) throws IOException { super(project); }