use of com.jenkinsci.plugins.badge.action.AbstractBadgeAction in project badge-plugin by jenkinsci.
the class RemoveBadgesStepTest method removeBadges.
private void removeBadges(String badgeScriptPrefix, String removeScript, String... remainingBadgeIds) throws Exception {
WorkflowJob p = r.jenkins.createProject(WorkflowJob.class, "p");
String script = badgeScriptPrefix + ", id: 'a')\n" + badgeScriptPrefix + ", id: 'b')\n" + removeScript;
p.setDefinition(new CpsFlowDefinition(script, true));
WorkflowRun b = r.assertBuildStatusSuccess(p.scheduleBuild2(0));
List<AbstractBadgeAction> badgeActions = b.getActions(AbstractBadgeAction.class);
assertEquals(remainingBadgeIds.length, badgeActions.size());
for (int i = 0; i < remainingBadgeIds.length; i++) {
assertEquals(remainingBadgeIds[i], badgeActions.get(i).getId());
}
}
Aggregations