Package com.atlassian.jira.rest.client.api.domain.util

Examples of com.atlassian.jira.rest.client.api.domain.util.ErrorCollection$Builder


      errors = JsonParseUtil.toStringMap(jsonErrors.names(), jsonErrors);
    } else {
      errors = Collections.emptyMap();
    }

    return new BulkOperationErrorResult(new ErrorCollection(status, errorMessages, errors), issueNumber);
  }
View Full Code Here


  public void testAddWorklogAsAnonymousWithoutPermissions() {
    setAnonymousMode();
    try {
      testAddWorklogImpl(ISSUE_KEY, createDefaulWorklogInputBuilder());
    } catch (RestClientException ex) {
      final ErrorCollection errors = Iterators.getOnlyElement(ex.getErrorCollections().iterator());
      assertThat(errors.getErrorMessages(),
          containsInAnyOrder("You do not have the permission to see the specified issue.", "Login Required"));
    }
  }
View Full Code Here

    if (jsonErrors != null && jsonErrors.length() > 0) {
      errors = JsonParseUtil.toStringMap(jsonErrors.names(), jsonErrors);
    } else {
      errors = Collections.emptyMap();
    }
    return new ErrorCollection(status, errorMessages, errors);
  }
View Full Code Here

        return false;
      }

      @Override
      public void describeTo(final Description description) {
        final ErrorCollection expectedErrorCollection = ErrorCollection.builder()
            .errorMessage(expectedErrorMessage).status(statusCode) .build();

        final RestClientException expectedException = new RestClientException(
            ImmutableList.of(expectedErrorCollection), statusCode);
View Full Code Here

  public static void assertErrorCodeWithRegexp(int errorCode, String regExp, Runnable runnable) {
    try {
      runnable.run();
      Assert.fail(RestClientException.class + " exception expected");
    } catch (com.atlassian.jira.rest.client.api.RestClientException ex) {
      final ErrorCollection errorElement = getOnlyElement(ex.getErrorCollections().iterator());
      final String errorMessage = getOnlyElement(errorElement.getErrorMessages().iterator());
      Assert.assertTrue("'" + ex.getMessage() + "' does not match regexp '" + regExp + "'", errorMessage.matches(regExp));
      Assert.assertTrue(ex.getStatusCode().isPresent());
      Assert.assertEquals(errorCode, ex.getStatusCode().get().intValue());
    }
  }
View Full Code Here

TOP

Related Classes of com.atlassian.jira.rest.client.api.domain.util.ErrorCollection$Builder

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.