Examples of SearchRestClient


Examples of com.atlassian.jira.rest.client.SearchRestClient

    protected List<BasicIssue> getIssues(String jql, int start, int maxResults, int maxPerQuery) {
        LOG.info("Indexing current JIRA issues...");

        List<BasicIssue> issues = new ArrayList<BasicIssue>();
        while (true) {
            SearchRestClient searchRestClient = client.getSearchClient();
            SearchResult searchResult = searchRestClient.searchJqlWithFullIssues(jql, maxPerQuery, start, null);

            for (BasicIssue issue : searchResult.getIssues()) {
                issues.add(issue);
            }
View Full Code Here

Examples of com.atlassian.jira.rest.client.api.SearchRestClient

    assertEquals(toDateTime("2010-07-05T00:00:00.000"), issue.getDueDate());
  }

  @Test
  public void jqlSearchWithMinimalFieldSetShouldReturnParseableIssues() throws Exception {
    final SearchRestClient searchClient = client.getSearchClient();
    final SearchResult searchResult = searchClient.searchJql("key=TST-1", null, null, REQUIRED_ISSUE_FIELDS).claim();
    final Issue issue = Iterables.getOnlyElement(searchResult.getIssues());
    assertEquals("TST-1", issue.getKey());
    assertEquals("My sample test", issue.getSummary());
    assertEquals("Bug", issue.getIssueType().getName());
    assertEquals(toDateTime("2010-07-23T12:16:56.000"), issue.getCreationDate());
View Full Code Here

Examples of com.atlassian.jira.rest.client.api.SearchRestClient

   * If this test fails, then maybe we accept missing field in issue parser? If yes, then we need to update
   * javadoc for {@link SearchRestClient#searchJql(String, Integer, Integer, Set)}
   */
  @Test
  public void jqlSearchWithoutOneOfRequiredFieldsShouldCauseParserFailure() {
    final SearchRestClient searchClient = client.getSearchClient();

    for (final String missingField : REQUIRED_ISSUE_FIELDS) {
      final Set<String> fieldsToRetrieve = Sets.difference(REQUIRED_ISSUE_FIELDS, Sets.newHashSet(missingField));

      try {
        searchClient.searchJql(null, 1, 0, fieldsToRetrieve).claim();
        throw new java.lang.AssertionError(String.format(
            "The above statement should throw exception. fieldsToRetrieve = %s, fields = %s, requiredFields = %s",
            missingField, fieldsToRetrieve, REQUIRED_ISSUE_FIELDS));
      } catch (RestClientException e) {
        final String expectedMessage = String.format(
View Full Code Here

Examples of com.atlassian.jira.rest.client.api.SearchRestClient

    assertEquals(toDateTime("2010-07-05T00:00:00.000"), issue.getDueDate());
  }

  @Test
  public void jqlSearchWithMinimalFieldSetShouldReturnParseableIssues() throws Exception {
    final SearchRestClient searchClient = client.getSearchClient();
    final SearchResult searchResult = searchClient.searchJql("key=TST-1", null, null, REQUIRED_ISSUE_FIELDS).claim();
    final Issue issue = Iterables.getOnlyElement(searchResult.getIssues());
    assertEquals("TST-1", issue.getKey());
    assertEquals("My sample test", issue.getSummary());
    assertEquals("Bug", issue.getIssueType().getName());
    assertEquals(toDateTime("2010-07-23T12:16:56.000"), issue.getCreationDate());
View Full Code Here

Examples of com.atlassian.jira.rest.client.api.SearchRestClient

   * If this test fails, then maybe we accept missing field in issue parser? If yes, then we need to update
   * javadoc for {@link SearchRestClient#searchJql(String, Integer, Integer, Set)}
   */
  @Test
  public void jqlSearchWithoutOneOfRequiredFieldsShouldCauseParserFailure() {
    final SearchRestClient searchClient = client.getSearchClient();

    for (final String missingField : REQUIRED_ISSUE_FIELDS) {
      final Set<String> fieldsToRetrieve = Sets.difference(REQUIRED_ISSUE_FIELDS, Sets.newHashSet(missingField));

      try {
        searchClient.searchJql(null, 1, 0, fieldsToRetrieve).claim();
        throw new java.lang.AssertionError(String.format(
            "The above statement should throw exception. fieldsToRetrieve = %s, fields = %s, requiredFields = %s",
            missingField, fieldsToRetrieve, REQUIRED_ISSUE_FIELDS));
      } catch (RestClientException e) {
        final String expectedMessage = String.format(
View Full Code Here

Examples of com.atlassian.jira.rest.client.api.SearchRestClient

    assertEquals(toDateTime("2010-07-05T00:00:00.000"), issue.getDueDate());
  }

  @Test
  public void jqlSearchWithMinimalFieldSetShouldReturnParseableIssues() throws Exception {
    final SearchRestClient searchClient = client.getSearchClient();
    final SearchResult searchResult = searchClient.searchJql("key=TST-1", null, null, REQUIRED_ISSUE_FIELDS).claim();
    final Issue issue = Iterables.getOnlyElement(searchResult.getIssues());
    assertEquals("TST-1", issue.getKey());
    assertEquals("My sample test", issue.getSummary());
    assertEquals("Bug", issue.getIssueType().getName());
    assertEquals(toDateTime("2010-07-23T12:16:56.000"), issue.getCreationDate());
View Full Code Here

Examples of com.atlassian.jira.rest.client.api.SearchRestClient

   * javadoc for {@link SearchRestClient#searchJql(String, Integer, Integer, String)}
   */
  @Test
  public void jqlSearchWithoutOneOfRequiredFieldsShouldCauseParserFailure() {
    final Set<String> requiredFields = Sets.newHashSet(Splitter.on(",").split(REQUIRED_ISSUE_FIELDS));
    final SearchRestClient searchClient = client.getSearchClient();

    for (final String missingField : requiredFields) {
      final Set<String> fieldsToRetrieve = Sets.difference(requiredFields, Sets.newHashSet(missingField));

      try {
        searchClient.searchJql(null, 1, 0, Joiner.on(",").join(fieldsToRetrieve)).claim();
        throw new java.lang.AssertionError(String.format(
            "The above statement should throw exception. fieldsToRetrieve = %s, fields = %s, requiredFields = %s",
            missingField, fieldsToRetrieve, requiredFields));
      } catch (RestClientException e) {
        final String expectedMessage = String.format(
View Full Code Here

Examples of com.atlassian.jira.rest.client.api.SearchRestClient

    assertEquals(toDateTime("2010-07-05T00:00:00.000"), issue.getDueDate());
  }

  @Test
  public void jqlSearchWithMinimalFieldSetShouldReturnParseableIssues() throws Exception {
    final SearchRestClient searchClient = client.getSearchClient();
    final SearchResult searchResult = searchClient.searchJql("key=TST-1", null, null, REQUIRED_ISSUE_FIELDS).claim();
    final Issue issue = Iterables.getOnlyElement(searchResult.getIssues());
    assertEquals("TST-1", issue.getKey());
    assertEquals("My sample test", issue.getSummary());
    assertEquals("Bug", issue.getIssueType().getName());
    assertEquals(toDateTime("2010-07-23T12:16:56.000"), issue.getCreationDate());
View Full Code Here

Examples of com.atlassian.jira.rest.client.api.SearchRestClient

   * If this test fails, then maybe we accept missing field in issue parser? If yes, then we need to update
   * javadoc for {@link SearchRestClient#searchJql(String, Integer, Integer, Set)}
   */
  @Test
  public void jqlSearchWithoutOneOfRequiredFieldsShouldCauseParserFailure() {
    final SearchRestClient searchClient = client.getSearchClient();

    for (final String missingField : REQUIRED_ISSUE_FIELDS) {
      final Set<String> fieldsToRetrieve = Sets.difference(REQUIRED_ISSUE_FIELDS, Sets.newHashSet(missingField));

      try {
        searchClient.searchJql(null, 1, 0, fieldsToRetrieve).claim();
        throw new java.lang.AssertionError(String.format(
            "The above statement should throw exception. fieldsToRetrieve = %s, fields = %s, requiredFields = %s",
            missingField, fieldsToRetrieve, REQUIRED_ISSUE_FIELDS));
      } catch (RestClientException e) {
        final String expectedMessage = String.format(
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.