@Test
public void testTransitionWithInvalidNumericField() throws Exception {
final Issue issue = client.getIssueClient().getIssue("TST-1", pm);
assertNull(issue.getField(NUMERIC_CUSTOMFIELD_ID).getValue());
final Iterable<Transition> transitions = client.getIssueClient().getTransitions(issue, pm);
final Transition transitionFound = TestUtil.getTransitionByName(transitions, "Estimate");
assertNotNull(transitionFound);
assertTrue(Iterables.contains(transitionFound.getFields(),
new Transition.Field(NUMERIC_CUSTOMFIELD_ID, false, TESTING_JIRA_5_OR_NEWER ? NUMERIC_CUSTOMFIELD_TYPE_V5 : NUMERIC_CUSTOMFIELD_TYPE)));
final FieldInput fieldInput = new FieldInput(NUMERIC_CUSTOMFIELD_ID, "]432jl");
// warning: Polish language here - I am asserting if the messages are indeed localized
// since 5.0 messages are changed and not localized
assertErrorCode(Response.Status.BAD_REQUEST, TESTING_JIRA_5_OR_NEWER
? "Operation value must be a number" : "']432jl' nie jest prawid\u0142ow\u0105 liczb\u0105", new Runnable() {
@Override
public void run() {
client.getIssueClient().transition(issue, new TransitionInput(transitionFound.getId(), Arrays.asList(fieldInput),
Comment.valueOf("My test comment")), pm);
}
});
}