IssueChangeContext context = IssueChangeContext.createUser(new Date(), "emmerik");
@Test
- public void should_assign() throws Exception {
+ public void assign() throws Exception {
User user = new DefaultUser().setLogin("emmerik").setName("Emmerik");
boolean updated = updater.assign(issue, user, context);
}
@Test
- public void should_unassign() throws Exception {
+ public void unassign() throws Exception {
issue.setAssignee("morgan");
boolean updated = updater.assign(issue, null, context);
assertThat(updated).isTrue();
}
@Test
- public void should_change_assignee() throws Exception {
+ public void change_assignee() throws Exception {
User user = new DefaultUser().setLogin("emmerik").setName("Emmerik");
issue.setAssignee("morgan");
}
@Test
- public void should_not_change_assignee() throws Exception {
+ public void not_change_assignee() throws Exception {
User user = new DefaultUser().setLogin("morgan").setName("Morgan");
issue.setAssignee("morgan");
}
@Test
- public void should_set_severity() throws Exception {
+ public void set_severity() throws Exception {
boolean updated = updater.setSeverity(issue, "BLOCKER", context);
assertThat(updated).isTrue();
assertThat(issue.severity()).isEqualTo("BLOCKER");
}
@Test
- public void should_set_past_severity() throws Exception {
+ public void set_past_severity() throws Exception {
issue.setSeverity("BLOCKER");
boolean updated = updater.setPastSeverity(issue, "INFO", context);
assertThat(updated).isTrue();
}
@Test
- public void should_update_severity() throws Exception {
+ public void update_severity() throws Exception {
issue.setSeverity("BLOCKER");
boolean updated = updater.setSeverity(issue, "MINOR", context);
}
@Test
- public void should_not_change_severity() throws Exception {
+ public void not_change_severity() throws Exception {
issue.setSeverity("MINOR");
boolean updated = updater.setSeverity(issue, "MINOR", context);
assertThat(updated).isFalse();
}
@Test
- public void should_not_revert_manual_severity() throws Exception {
+ public void not_revert_manual_severity() throws Exception {
issue.setSeverity("MINOR").setManualSeverity(true);
try {
updater.setSeverity(issue, "MAJOR", context);
}
@Test
- public void should_set_manual_severity() throws Exception {
+ public void set_manual_severity() throws Exception {
issue.setSeverity("BLOCKER");
boolean updated = updater.setManualSeverity(issue, "MINOR", context);
}
@Test
- public void should_not_change_manual_severity() throws Exception {
+ public void not_change_manual_severity() throws Exception {
issue.setSeverity("MINOR").setManualSeverity(true);
boolean updated = updater.setManualSeverity(issue, "MINOR", context);
assertThat(updated).isFalse();
}
@Test
- public void should_set_line() throws Exception {
+ public void set_line() throws Exception {
boolean updated = updater.setLine(issue, 123);
assertThat(updated).isTrue();
assertThat(issue.line()).isEqualTo(123);
}
@Test
- public void should_set_past_line() throws Exception {
+ public void set_past_line() throws Exception {
issue.setLine(42);
boolean updated = updater.setPastLine(issue, 123);
assertThat(updated).isTrue();
}
@Test
- public void should_not_change_line() throws Exception {
+ public void not_change_line() throws Exception {
issue.setLine(123);
boolean updated = updater.setLine(issue, 123);
assertThat(updated).isFalse();
}
@Test
- public void should_set_resolution() throws Exception {
+ public void set_resolution() throws Exception {
boolean updated = updater.setResolution(issue, "OPEN", context);
assertThat(updated).isTrue();
assertThat(issue.resolution()).isEqualTo("OPEN");
}
@Test
- public void should_not_change_resolution() throws Exception {
+ public void not_change_resolution() throws Exception {
issue.setResolution("FIXED");
boolean updated = updater.setResolution(issue, "FIXED", context);
assertThat(updated).isFalse();
}
@Test
- public void should_set_status() throws Exception {
+ public void set_status() throws Exception {
boolean updated = updater.setStatus(issue, "OPEN", context);
assertThat(updated).isTrue();
assertThat(issue.status()).isEqualTo("OPEN");
}
@Test
- public void should_not_change_status() throws Exception {
+ public void not_change_status() throws Exception {
issue.setStatus("CLOSED");
boolean updated = updater.setStatus(issue, "CLOSED", context);
assertThat(updated).isFalse();
}
@Test
- public void should_set_new_attribute_value() throws Exception {
+ public void set_new_attribute_value() throws Exception {
boolean updated = updater.setAttribute(issue, "JIRA", "FOO-123", context);
assertThat(updated).isTrue();
assertThat(issue.attribute("JIRA")).isEqualTo("FOO-123");
}
@Test
- public void should_unset_attribute() throws Exception {
+ public void unset_attribute() throws Exception {
issue.setAttribute("JIRA", "FOO-123");
boolean updated = updater.setAttribute(issue, "JIRA", null, context);
assertThat(updated).isTrue();
}
@Test
- public void should_not_update_attribute() throws Exception {
+ public void not_update_attribute() throws Exception {
issue.setAttribute("JIRA", "FOO-123");
boolean updated = updater.setAttribute(issue, "JIRA", "FOO-123", context);
assertThat(updated).isFalse();
}
@Test
- public void should_plan_with_no_existing_plan() throws Exception {
+ public void plan_with_no_existing_plan() throws Exception {
ActionPlan newActionPlan = DefaultActionPlan.create("newName");
boolean updated = updater.plan(issue, newActionPlan, context);
}
@Test
- public void should_plan_with_existing_plan() throws Exception {
+ public void plan_with_existing_plan() throws Exception {
issue.setActionPlanKey("formerActionPlan");
ActionPlan newActionPlan = DefaultActionPlan.create("newName").setKey("newKey");
}
@Test
- public void should_unplan() throws Exception {
+ public void unplan() throws Exception {
issue.setActionPlanKey("formerActionPlan");
boolean updated = updater.plan(issue, null, context);
}
@Test
- public void should_not_plan_again() throws Exception {
+ public void not_plan_again() throws Exception {
issue.setActionPlanKey("existingActionPlan");
ActionPlan newActionPlan = DefaultActionPlan.create("existingActionPlan").setKey("existingActionPlan");
}
@Test
- public void should_set_effort_to_fix() throws Exception {
+ public void set_effort_to_fix() throws Exception {
boolean updated = updater.setEffortToFix(issue, 3.14, context);
assertThat(updated).isTrue();
assertThat(issue.isChanged()).isTrue();
}
@Test
- public void should_not_set_effort_to_fix_if_unchanged() throws Exception {
+ public void not_set_effort_to_fix_if_unchanged() throws Exception {
issue.setEffortToFix(3.14);
boolean updated = updater.setEffortToFix(issue, 3.14, context);
assertThat(updated).isFalse();
}
@Test
- public void should_set_past_effort() throws Exception {
+ public void set_past_effort() throws Exception {
issue.setEffortToFix(3.14);
boolean updated = updater.setPastEffortToFix(issue, 1.0, context);
assertThat(updated).isTrue();
}
@Test
- public void should_set_message() throws Exception {
+ public void set_past_remediation_cost() throws Exception {
+ issue.setRemediationCost(15l);
+ boolean updated = updater.setPastRemediationCost(issue, 10l, context);
+ assertThat(updated).isTrue();
+ assertThat(issue.remediationCost()).isEqualTo(15L);
+
+ FieldDiffs.Diff diff = issue.currentChange().get("remediationCost");
+ assertThat(diff.oldValue()).isEqualTo(10L);
+ assertThat(diff.newValue()).isEqualTo(15L);
+ assertThat(issue.mustSendNotifications()).isFalse();
+ }
+
+ @Test
+ public void set_message() throws Exception {
boolean updated = updater.setMessage(issue, "the message", context);
assertThat(updated).isTrue();
assertThat(issue.isChanged()).isTrue();
}
@Test
- public void should_set_past_message() throws Exception {
+ public void set_past_message() throws Exception {
issue.setMessage("new message");
boolean updated = updater.setPastMessage(issue, "past message", context);
assertThat(updated).isTrue();
}
@Test
- public void should_set_author() throws Exception {
+ public void set_author() throws Exception {
boolean updated = updater.setAuthorLogin(issue, "eric", context);
assertThat(updated).isTrue();
assertThat(issue.authorLogin()).isEqualTo("eric");
assertThat(diff.newValue()).isEqualTo("eric");
assertThat(issue.mustSendNotifications()).isFalse();
}
+
}