Package com.atlassian.jira.rest.client.domain.input

Examples of com.atlassian.jira.rest.client.domain.input.FieldInput


  @Test
  public void testTransitionWithNumericCustomFieldEnglishLocale() throws Exception {
    setUser1();
    final double newValue = 123.45;
    final FieldInput fieldInput = new FieldInput(NUMERIC_CUSTOMFIELD_ID,
        NumberFormat.getNumberInstance(new Locale("pl")).format(newValue));

    assertErrorCode(Response.Status.BAD_REQUEST, IntegrationTestUtil.TESTING_JIRA_5_OR_NEWER
        ? "Operation value must be a number" : ("'" + fieldInput.getValue() + "' is an invalid number"), new Runnable() {
      @Override
      public void run() {
        assertTransitionWithNumericCustomField(fieldInput, newValue);
      }
    });

    final FieldInput fieldInput2 = new FieldInput(NUMERIC_CUSTOMFIELD_ID, newValue); // this will be serialized always with "." according to JSL
    assertTransitionWithNumericCustomField(fieldInput2, newValue);

  }
View Full Code Here


    assertNotNull(transitionFound);
    assertTrue(Iterables.contains(transitionFound.getFields(),
        new Transition.Field(NUMERIC_CUSTOMFIELD_ID, false, IntegrationTestUtil.TESTING_JIRA_5_OR_NEWER ? NUMERIC_CUSTOMFIELD_TYPE_V5 : NUMERIC_CUSTOMFIELD_TYPE)));
    final double newValue = 123;
    final FieldInput fieldInput = new FieldInput(NUMERIC_CUSTOMFIELD_ID, newValue);
    client.getIssueClient().transition(issue.getTransitionsUri(), new TransitionInput(transitionFound.getId(), Arrays.asList(fieldInput),
        Comment.valueOf("My test comment")), pm);
    final Issue changedIssue = client.getIssueClient().getIssue("TST-1", pm);
    assertEquals(newValue, changedIssue.getField(NUMERIC_CUSTOMFIELD_ID).getValue());
  }
View Full Code Here

    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
View Full Code Here

    final Transition startProgressTransition = getTransitionByName(transitions, "Start Progress");
    restClient.getIssueClient().transition(issue.getTransitionsUri(), new TransitionInput(startProgressTransition.getId()), pm);

    // and now let's resolve it as Incomplete
    final Transition resolveIssueTransition = getTransitionByName(transitions, "Resolve Issue");
    Collection<FieldInput> fieldInputs = Arrays.asList(new FieldInput("resolution", "Incomplete"));
    final TransitionInput transitionInput = new TransitionInput(resolveIssueTransition.getId(), fieldInputs, Comment.valueOf("My comment"));
    restClient.getIssueClient().transition(issue.getTransitionsUri(), transitionInput, pm);

  }
View Full Code Here

public class JerseyIssueRestClientTest extends AbstractJerseyRestClientTest {

  @Test
  public void testTransitionWithNumericCustomFieldPolishLocale() throws Exception {
    final double newValue = 123.45;
    final FieldInput fieldInput;
    if (IntegrationTestUtil.TESTING_JIRA_5_OR_NEWER) {
      fieldInput = new FieldInput(NUMERIC_CUSTOMFIELD_ID, newValue);
    } else {
      fieldInput = new FieldInput(NUMERIC_CUSTOMFIELD_ID, NumberFormat.getNumberInstance(new Locale("pl")).format(newValue));
    }
    assertTransitionWithNumericCustomField(fieldInput, newValue);
  }
View Full Code Here

  @Test
  public void testTransitionWithNumericCustomFieldEnglishLocale() throws Exception {
    setUser1();
    final double newValue = 123.45;
    final FieldInput fieldInput = new FieldInput(NUMERIC_CUSTOMFIELD_ID,
        NumberFormat.getNumberInstance(new Locale("pl")).format(newValue));

    assertErrorCode(Response.Status.BAD_REQUEST, IntegrationTestUtil.TESTING_JIRA_5_OR_NEWER
        ? "Operation value must be a number" : ("'" + fieldInput.getValue() + "' is an invalid number"), new Runnable() {
      @Override
      public void run() {
        assertTransitionWithNumericCustomField(fieldInput, newValue);
      }
    });

    final FieldInput fieldInput2 = new FieldInput(NUMERIC_CUSTOMFIELD_ID, newValue); // this will be serialized always with "." according to JSL
    assertTransitionWithNumericCustomField(fieldInput2, newValue);

  }
View Full Code Here

    assertNotNull(transitionFound);
    assertTrue(Iterables.contains(transitionFound.getFields(),
        new Transition.Field(NUMERIC_CUSTOMFIELD_ID, false, IntegrationTestUtil.TESTING_JIRA_5_OR_NEWER ? NUMERIC_CUSTOMFIELD_TYPE_V5 : NUMERIC_CUSTOMFIELD_TYPE)));
    final double newValue = 123;
    final FieldInput fieldInput = new FieldInput(NUMERIC_CUSTOMFIELD_ID, newValue);
    client.getIssueClient().transition(issue, new TransitionInput(transitionFound.getId(), Arrays.asList(fieldInput),
        Comment.valueOf("My test comment")), pm);
    final Issue changedIssue = client.getIssueClient().getIssue("TST-1", pm);
    assertEquals(newValue, changedIssue.getField(NUMERIC_CUSTOMFIELD_ID).getValue());
  }
View Full Code Here

    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
View Full Code Here

TOP

Related Classes of com.atlassian.jira.rest.client.domain.input.FieldInput

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.