diff --git a/src/main/java/hudson/plugins/jacoco/JacocoPublisher.java b/src/main/java/hudson/plugins/jacoco/JacocoPublisher.java index eada8d55..3121561b 100644 --- a/src/main/java/hudson/plugins/jacoco/JacocoPublisher.java +++ b/src/main/java/hudson/plugins/jacoco/JacocoPublisher.java @@ -484,7 +484,7 @@ public void perform(@Nonnull Run run, @Nonnull FilePath filePath, @Nonnull final JacocoBuildAction action = JacocoBuildAction.load(run, healthReports, taskListener, dir, includes, excludes); action.getThresholds().ensureValid(); logger.println("[JaCoCo plugin] Thresholds: " + action.getThresholds()); - run.getActions().add(action); + run.addAction(action); logger.println("[JaCoCo plugin] Publishing the results.."); final CoverageReport result = action.getResult(); diff --git a/src/test/java/hudson/plugins/jacococoveragecolumn/JaCoCoColumnTest.java b/src/test/java/hudson/plugins/jacococoveragecolumn/JaCoCoColumnTest.java index 4c6731dc..74b4bf14 100644 --- a/src/test/java/hudson/plugins/jacococoveragecolumn/JaCoCoColumnTest.java +++ b/src/test/java/hudson/plugins/jacococoveragecolumn/JaCoCoColumnTest.java @@ -87,7 +87,7 @@ public void testGetPercentWithBuildAndAction() { public Run getLastSuccessfulBuild() { try { Run newBuild = newBuild(); - newBuild.getActions().add(new JacocoBuildAction(null, null, StreamTaskListener.fromStdout(), null, null)); + newBuild.addAction(new JacocoBuildAction(null, null, StreamTaskListener.fromStdout(), null, null)); assertEquals(1, newBuild.getActions().size()); return newBuild; } catch (IOException e) {