Пример #1
0
  @Test
  public void testLoginUser() throws Exception {
    User user = createUser();
    api.createUser(user);

    String token = api.loginUser(user.getUsername(), user.getPassword());
    assertTrue(token.startsWith("logged in user session:"));
  }
Пример #2
0
  @Test
  public void testCreateUser() throws Exception {
    User user = createUser();

    api.createUser(user);

    User fetched = api.getUserByName(user.getUsername());
    assertEquals(user.getId(), fetched.getId());
  }