Beispiel #1
0
  private static void printCurrentUser(RedmineManager mgr) throws Exception {
    User currentUser = mgr.getCurrentUser();
    logger.debug("user="******"*****@*****.**");
    mgr.update(currentUser);
    logger.debug("updated user");

    User currentUser2 = mgr.getCurrentUser();
    logger.debug("updated user's mail: " + currentUser2.getMail());
  }
 @Test
 public void testParseUsers() throws IOException, JSONException {
   String json = MyIOUtils.getResourceAsString("redmine_users.json");
   List<User> users =
       JsonInput.getListOrEmpty(
           RedmineJSONParser.getResponse(json), "users", RedmineJSONParser.USER_PARSER);
   boolean found = false;
   for (User u : users) {
     if (u.getLogin().equals("dina")) {
       found = true;
     }
   }
   Assert.assertTrue("Admin user must be among all the users", found);
 }
  @Test
  public void testParseIssues() throws IOException, JSONException {
    List<Issue> objects = loadRedmine11Issues();
    Integer issueId = 68;
    Issue issue68 = RedmineTestUtils.findIssueInList(objects, issueId);
    Assert.assertNotNull(issue68);
    Assert.assertEquals(issueId, issue68.getId());
    Integer statusId = 1;
    Assert.assertEquals(statusId, issue68.getStatusId());
    Assert.assertEquals("New", issue68.getStatusName());

    User author = issue68.getAuthor();
    Assert.assertNotNull(author);
    Integer userId = 1;
    Assert.assertEquals(userId, author.getId());
  }
Beispiel #4
0
 private static void generateXMLForUser() {
   User u = new User();
   u.setLogin("newlogin");
   String xml = RedmineXMLGenerator.toXML(u);
   logger.debug(xml);
 }