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

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


   * 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

    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

   * 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

    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

   * 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

    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

   * 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

Related Classes of com.atlassian.jira.rest.client.api.SearchRestClient

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.