use of com.jenkinsci.plugins.badge.action.BadgeSummaryAction in project badge-plugin by jenkinsci.
the class CreateSummaryStepTest method createSummary_plain.
@Test
public void createSummary_plain() throws Exception {
String text = randomUUID().toString();
BadgeSummaryAction action = createSummary("summary.appendText('" + text + "')");
assertEquals(text, action.getText());
}
use of com.jenkinsci.plugins.badge.action.BadgeSummaryAction in project badge-plugin by jenkinsci.
the class RemoveSummariesStepTest method removeSummaries.
private void removeSummaries(String removeScript, String... remainingBadgeIds) throws Exception {
String icon = randomUUID().toString();
WorkflowJob p = r.jenkins.createProject(WorkflowJob.class, "p");
p.setDefinition(new CpsFlowDefinition("def summaryA = createSummary(id:'a', icon:\"" + icon + "\")\n" + "def summaryB = createSummary(id:'b', icon:\"" + icon + "\")\n" + removeScript, true));
WorkflowRun b = r.assertBuildStatusSuccess(p.scheduleBuild2(0));
List<BadgeSummaryAction> summaryActions = b.getActions(BadgeSummaryAction.class);
assertEquals(remainingBadgeIds.length, summaryActions.size());
for (int i = 0; i < remainingBadgeIds.length; i++) {
assertEquals(remainingBadgeIds[i], summaryActions.get(i).getId());
}
}
Aggregations