use of com.jenkinsci.plugins.badge.action.HtmlBadgeAction in project badge-plugin by jenkinsci.
the class AddHtmlBadgeStepTest method addHtmlBadge.
@Test
public void addHtmlBadge() throws Exception {
String html = UUID.randomUUID().toString();
WorkflowJob p = r.jenkins.createProject(WorkflowJob.class, "p");
String script = "addHtmlBadge(\"" + html + "\")";
p.setDefinition(new CpsFlowDefinition(script, true));
WorkflowRun b = r.assertBuildStatusSuccess(p.scheduleBuild2(0));
List<BuildBadgeAction> badgeActions = b.getBadgeActions();
assertEquals(1, badgeActions.size());
HtmlBadgeAction action = (HtmlBadgeAction) badgeActions.get(0);
assertEquals(html, action.getHtml());
}
Aggregations