Package zendeskapi

Examples of zendeskapi.ZendeskApi


import zendeskapi.models.users.User;

public class UsersIntegrationTest extends ZendeskApiTest {
  @Test
  public void testGetAllUsers() throws Exception {
    ZendeskApi api = new ZendeskApi(URL, USER, PASSWORD);
    GroupUserResponse users = api.getUsers().getAllUsers();
    Assert.assertTrue(users.getCount() > 0);
  }
View Full Code Here


    Assert.assertTrue(users.getCount() > 0);
  }

  @Test
  public void testGetOneUser() throws Exception {
    ZendeskApi api = new ZendeskApi(URL, USER, PASSWORD);
    GroupUserResponse users = api.getUsers().getAllUsers();
    long id = users.getUsers().get(0).getId();
    User user = api.getUsers().getUser(id).getUser();
    Assert.assertEquals(user.getEmail(), "johan.groth@linuxgrotto.org.uk");
  }
View Full Code Here

    Assert.assertEquals(user.getEmail(), "johan.groth@linuxgrotto.org.uk");
  }

  @Test
  public void testGetCurrentUser() throws Exception {
    ZendeskApi api = new ZendeskApi(URL, USER, PASSWORD);
    User user = api.getUsers().getCurrentUser().getUser();
    Assert.assertEquals(user.getEmail(), USER);
  }
View Full Code Here

public class AttachmentsIntegrationTest extends ZendeskApiTest {

  @Test
  public void testUploadOfFile() throws Exception {
    ZendeskApi api = new ZendeskApi(URL, USER, PASSWORD);
    Attachments attachments = api.getAttachments();
    ZendeskFile file = new ZendeskFile("src/test/resources/attachments/attachment01.dat");
    file.setFileName("attachment01.dat");
    Upload upload = attachments.uploadAttachment(file);
    Assert.assertNotNull(upload);
    Assert.assertEquals(upload.getAttachments().size(), 1);
View Full Code Here

    Assert.assertEquals(upload.getAttachments().get(0).getSize().intValue(), 2048);
  }
 
  @Test
  public void testUploadOfThreeFiles() throws Exception {
    ZendeskApi api = new ZendeskApi(URL, USER, PASSWORD);
    Attachments attachments = api.getAttachments();
    ZendeskFile file = new ZendeskFile("src/test/resources/attachments/attachment01.dat");
    file.setFileName("attachment01.dat");   
    List<ZendeskFile> files = new ArrayList<ZendeskFile>();
    files.add(file);
    file = new ZendeskFile("src/test/resources/attachments/attachment02.dat");
View Full Code Here

    Assert.assertEquals(upload.getAttachments().get(2).getSize().intValue(), 16384);
  }
 
  @Test
  public void testUploadOfLargeFile() throws Exception {
    ZendeskApi api = new ZendeskApi(URL, USER, PASSWORD);
    Attachments attachments = api.getAttachments();
    ZendeskFile file = new ZendeskFile("src/test/resources/attachments/attachment04.dat");
    file.setFileName("attachment04.dat");
    Upload upload = attachments.uploadAttachment(file);
    Assert.assertNotNull(upload);
    Assert.assertEquals(upload.getAttachments().size(), 1);
View Full Code Here

   
  }

  @Test
  public void testUploadOfTooLargeFile() throws Exception {
    ZendeskApi api = new ZendeskApi(URL, USER, PASSWORD);
    Attachments attachments = api.getAttachments();
    ZendeskFile file = new ZendeskFile("src/test/resources/attachments/attachment05.dat");
    file.setFileName("attachment05.dat");
    try {
      attachments.uploadAttachment(file);     
    } catch (ZendeskApiException e) {
View Full Code Here

TOP

Related Classes of zendeskapi.ZendeskApi

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.