@Test
  public void testCreateTask() throws Exception {
    TaskBuilder builder = taskService.createTask();
    builder.creator(user);
    builder.project(project);
    builder.name(name);
    builder.description(desc);
    builder.testSteps(teststeps);
    builder.type(type);
    builder.estimated(8);
    builder.priority(priority);
    Task task = builder.build();

    task.store();

    assertNotNull(task);
    assertTrue(task.getId() > 0);
    assertEquals(name, task.getName());
    assertEquals(desc, task.getDescription());
    assertEquals(teststeps, task.getTestSteps());
    assertEquals(user.getName(), task.getCreator().getName());
    assertEquals(user.getName(), task.getAssignee().getName());
    assertEquals("New", task.getStatus().getName());
    assertEquals(priority, task.getPriority());
    assertEquals(type, task.getType());
  }
Пример #2
0
  @Test
  public void UserNameTest() {
    User u = new User();

    u.setName("foo");

    assertEquals("foo", u.getName());
  }
Пример #3
0
 @Test
 public void testCostruttoreTot() {
   initTot();
   assertTrue("Username non è quello atteso", user.getUsername() == "Liquid90");
   assertTrue("Nome non è quello atteso", user.getName() == "Giacomo");
   assertTrue("Cognome non è quello atteso", user.getSurname() == "Bain");
   assertTrue("IP non è quello atteso", user.getIP() == "0.0.10.10");
 }
Пример #4
0
 @Test
 public void testReadFrom() {
   final User user = target("user").request().accept("application/json").get(User.class);
   assertNotNull(user);
   assertNotNull(user.getCreatedOn());
   assertEquals(user.getId().longValue(), 12345L);
   assertEquals(user.getName(), "smallnest");
 }
  @Test
  public void change_one_field_and_other_attributes_are_the_same() {
    createFullUser("cnaoaats");
    createUpdateUserWithJustOtherNickname();

    updateUser();

    assertNotEquals(testUser.getNickName(), returnUser.getNickName());
    assertEquals(testUser.isActive(), returnUser.isActive());
    assertEquals(testUser.getDisplayName(), returnUser.getDisplayName());
    assertEquals(testUser.getExternalId(), returnUser.getExternalId());
    assertEquals(testUser.getLocale(), returnUser.getLocale());
    assertEquals(testUser.getPreferredLanguage(), returnUser.getPreferredLanguage());
    assertEquals(testUser.getProfileUrl(), returnUser.getProfileUrl());
    assertEquals(testUser.getTimezone(), returnUser.getTimezone());
    assertEquals(testUser.getTitle(), returnUser.getTitle());
    assertEquals(testUser.getUserType(), returnUser.getUserType());
    assertEquals(testUser.getName().getFamilyName(), returnUser.getName().getFamilyName());
  }
  @Test
  public void delete_all_single_values() {
    createFullUser("desv");
    createUpdateUserWithDeleteFields();

    updateUser();

    assertNull(returnUser.getNickName());
    assertNull(returnUser.getDisplayName());
    assertNull(returnUser.getLocale());
    assertNull(returnUser.getPreferredLanguage());
    assertNull(returnUser.getProfileUrl());
    assertNull(returnUser.getTimezone());
    assertNull(returnUser.getTitle());
    assertNull(returnUser.getUserType());
    assertNull(returnUser.getName());
    assertNull(returnUser.getExternalId());
  }
  @Test
  public void update_all_single_values() {
    createFullUser("uasv");
    createUpdateUserWithUpdateFields();

    updateUser();

    assertEquals("UserName", returnUser.getUserName());
    assertEquals("NickName", returnUser.getNickName());
    assertNotEquals(testUser.isActive(), returnUser.isActive());
    assertEquals("DisplayName", returnUser.getDisplayName());
    assertEquals("ExternalId", returnUser.getExternalId());
    assertEquals("Locale", returnUser.getLocale());
    assertEquals("PreferredLanguage", returnUser.getPreferredLanguage());
    assertEquals("ProfileUrl", returnUser.getProfileUrl());
    assertEquals("Timezone", returnUser.getTimezone());
    assertEquals("Title", returnUser.getTitle());
    assertEquals("UserType", returnUser.getUserType());
    assertEquals("FamilyName", returnUser.getName().getFamilyName());
    assertEquals("ExternalId", returnUser.getExternalId());
  }