Package zendeskapi.models.categories

Examples of zendeskapi.models.categories.Category


  }

  @Test
  public void testGetForumsByCategory() throws Exception {
    Categories categories = API.getCategories();
    Category category = new Category();
    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());
    List<Forum> forums = groupForumResponse.getForums();
    for (Forum f : forums) {
      Assert.assertEquals(f.getCategoryId(), responseCategory.getId());
    }
    Assert.assertTrue(API.getCategories().deleteCategory(responseCategory.getId()));
  }
View Full Code Here


  }

  @Test
  public void testCreateCategory() throws Exception {
    Categories categories = API.getCategories();
    Category category = new Category();
    category.setDescription("Test category description 1");
    category.setName("Test category name 1");
    IndividualCategoryResponse individualCategoryResponse = categories.createCategory(category);
    Category responseCategory = individualCategoryResponse.getCategory();
    Assert.assertEquals(responseCategory.getName(), category.getName());
    Assert.assertEquals(responseCategory.getDescription(), category.getDescription());
    ids.add(responseCategory.getId());
  }
View Full Code Here

  }

  @Test
  public void testDeleteCategory() throws Exception {
    Categories categories = API.getCategories();
    Category category = new Category();
    category.setDescription("Test category description 1");
    category.setName("Test category name 1");
    IndividualCategoryResponse individualCategoryResponse = categories.createCategory(category);
    Assert.assertTrue(categories.deleteCategory(individualCategoryResponse.getCategory().getId()));
  }
View Full Code Here

  public void testGetCategories() throws Exception {
    createCategories();
    Categories categories = API.getCategories();
    GroupCategoryResponse groupCategoryResponse = categories.getCategories();
    Assert.assertEquals(groupCategoryResponse.getCategories().size(), 3);
    Category category = groupCategoryResponse.getCategories().get(0);
    Assert.assertEquals(category.getName(), "Test category name 1");
    Assert.assertEquals(category.getDescription(), "Test category description 1");
    category = groupCategoryResponse.getCategories().get(1);
    Assert.assertEquals(category.getName(), "Test category name 2");
    Assert.assertEquals(category.getDescription(), "Test category description 2");
    category = groupCategoryResponse.getCategories().get(2);
    Assert.assertEquals(category.getName(), "Test category name 3");
    Assert.assertEquals(category.getDescription(), "Test category description 3");   
  }
View Full Code Here

    createCategories();
    Categories categories = API.getCategories();
    GroupCategoryResponse groupCategoryResponse = categories.getCategories();
    for (Category category : groupCategoryResponse.getCategories()) {
      IndividualCategoryResponse individualCategoryResponse = categories.getCategoryById(category.getId());
      Category responseCategory = individualCategoryResponse.getCategory();
      Assert.assertEquals(responseCategory.getId(), category.getId());
      Assert.assertEquals(responseCategory.getName(), category.getName());
      Assert.assertEquals(responseCategory.getDescription(), category.getDescription());
    }
  }
View Full Code Here

  @Test
  public void testUpdateCategory() throws Exception {
    createCategories();
    Categories categories = API.getCategories();
    GroupCategoryResponse groupCategoryResponse = categories.getCategories();
    Category category = groupCategoryResponse.getCategories().get(0);
    category.setDescription("Test updated description 1");
    IndividualCategoryResponse individualCategoryResponse = categories.updateCategory(category);
    Category responseCategory = individualCategoryResponse.getCategory();
    Assert.assertEquals(responseCategory.getDescription(), category.getDescription());
  }
View Full Code Here

    Assert.assertEquals(responseCategory.getDescription(), category.getDescription());
  }

  private void createCategories() throws Exception {
    Categories categories = API.getCategories();
    Category category = new Category();
    category.setDescription("Test category description 1");
    category.setName("Test category name 1");
    IndividualCategoryResponse individualCategoryResponse = categories.createCategory(category);
    ids.add(individualCategoryResponse.getCategory().getId());
    category = new Category();
    category.setDescription("Test category description 2");
    category.setName("Test category name 2");
    individualCategoryResponse = categories.createCategory(category);
    ids.add(individualCategoryResponse.getCategory().getId());
    category = new Category();
    category.setDescription("Test category description 3");
    category.setName("Test category name 3");
    individualCategoryResponse = categories.createCategory(category);
    ids.add(individualCategoryResponse.getCategory().getId());
  }
View Full Code Here

TOP

Related Classes of zendeskapi.models.categories.Category

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.