Package zendeskapi.models.forums

Examples of zendeskapi.models.forums.Forum


    forumIds.clear();
  }

  @Test
  public void testCreateForum() throws Exception {
    Forum forum = new Forum();
    forum.setName("Test forum 1");
    IndividualForumResponse individualForumResponse = API.getForums().createForum(forum);
    Forum responseForum = individualForumResponse.getForum();
    Assert.assertEquals(responseForum.getName(), forum.getName());
    forumIds.add(responseForum.getId());
  }
View Full Code Here


  }

  @Test
  public void testGetForumById() throws Exception {
    GroupForumResponse groupForumResponse = API.getForums().getForums();
    Forum forum = groupForumResponse.getForums().get(0);
    IndividualForumResponse individualForumResponse = API.getForums().getForumById(forum.getId());
    Assert.assertEquals(individualForumResponse.getForum().getDescription(), forum.getDescription());
    Assert.assertEquals(individualForumResponse.getForum().getId(), forum.getId());
  }
View Full Code Here

    Assert.assertEquals(individualForumResponse.getForum().getId(), forum.getId());
  }

  @Test
  public void testDeleteForum() throws Exception {
    Forum forum = new Forum();
    forum.setName("Test forum 1");
    IndividualForumResponse individualForumResponse = API.getForums().createForum(forum);
    Forum responseForum = individualForumResponse.getForum();
    Assert.assertTrue(API.getForums().deleteForum(responseForum.getId()));
  }
View Full Code Here

    Assert.assertTrue(API.getForums().deleteForum(responseForum.getId()));
  }

  @Test
  public void testUpdateForum() throws Exception {
    Forum forum = new Forum();
    forum.setName("Test forum 1");
    IndividualForumResponse individualForumResponse = API.getForums().createForum(forum);
    forumIds.add(individualForumResponse.getForum().getId());
    Forum responseForum = individualForumResponse.getForum();
    responseForum.setName("Test update forum 1");
    individualForumResponse = API.getForums().updateForum(responseForum);
    responseForum = individualForumResponse.getForum();
    Assert.assertEquals(responseForum.getName(), "Test update forum 1");
  }
View Full Code Here

    category.setDescription("Test category description 99");
    category.setName("Test category name 99");
    IndividualCategoryResponse individualCategoryResponse = categories.createCategory(category);
    Category responseCategory = individualCategoryResponse.getCategory();
   
    Forum forum = new Forum();
    forum.setName("Test forum 1");
    forum.setCategoryId(responseCategory.getId());
    IndividualForumResponse individualForumResponse = API.getForums().createForum(forum);
   
    forumIds.add(individualForumResponse.getForum().getId());
   
    GroupForumResponse groupForumResponse = API.getForums().getForumsByCategory(responseCategory.getId());
View Full Code Here

    Assert.assertTrue(API.getForums().deleteForumSubscription(individualForumSubcriptionResponse.getForumSubscription().getId()));
  }

  @Test
  public void testCreateForumSubscription() throws Exception {
    Forum forum = API.getForums().getForums().getForums().get(0);
    ForumSubscription forumSubscription = new ForumSubscription();
    forumSubscription.setForumId(forum.getId());
    forumSubscription.setUserId(USER_ID);
    IndividualForumSubcriptionResponse individualForumSubcriptionResponse = API.getForums().createForumSubscription(forumSubscription);
    Assert.assertTrue(individualForumSubcriptionResponse.getForumSubscription().getId() > 0);
    Assert.assertTrue(API.getForums().deleteForumSubscription(individualForumSubcriptionResponse.getForumSubscription().getId()));
  }
View Full Code Here

    return API.getForums().getForumSubscriptionsById(forumSubscriptionIds.get(0));
  }

  private void createForumSubscriptionForAllForums() throws ZendeskApiException {
    for (Long forumId : forumIds) {
      Forum forum = API.getForums().getForumById(forumId).getForum();
      ForumSubscription forumSubscription = new ForumSubscription();
      forumSubscription.setForumId(forum.getId());
      forumSubscription.setUserId(USER_ID);
      IndividualForumSubcriptionResponse individualForumSubcriptionResponse = API.getForums().createForumSubscription(forumSubscription);
      Assert.assertTrue(individualForumSubcriptionResponse.getForumSubscription().getId() > 0);
      forumSubscriptionIds.add(individualForumSubcriptionResponse.getForumSubscription().getId());
    }
View Full Code Here

      forumSubscriptionIds.add(individualForumSubcriptionResponse.getForumSubscription().getId());
    }
  }

  private GroupForumResponse createForums() throws ZendeskApiException {
    Forum forum = new Forum();
    for (int i = 0; i < 5; i++) {
      forum.setName("Test forum " + i);
      IndividualForumResponse individualForumResponse = API.getForums().createForum(forum);
      Forum responseForum = individualForumResponse.getForum();
      Assert.assertEquals(responseForum.getName(), forum.getName());
      forumIds.add(responseForum.getId());
    }
    return API.getForums().getForums();
  }
View Full Code Here

TOP

Related Classes of zendeskapi.models.forums.Forum

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.