Trackers can be added to a project object, however after calling projectManager.update the new trackers have not been added to Redmine.
It seems that java api tries to add tracker objects, but Redmine api requires an array of tracker ids.
Some code to test this, latest assert fails when checking if Redmine has been updated
@Test
public void testUpdateTrackers() throws RedmineException {
Project projectToCreate = generateRandomProject();
String createdProjectKey = null;
try {
Project createdProject = projectManager.createProject(projectToCreate);
createdProjectKey = createdProject.getIdentifier();
Collection<Tracker> trackers=createdProject.getTrackers();
assertEquals("assume redmine is configured with 1-Bug as default tracker", 1, trackers.size());
Collection<Tracker> newTrackers=new ArrayList<Tracker>();
newTrackers.add(TrackerFactory.create(2,"Feature"));
newTrackers.add(TrackerFactory.create(3,"Support"));
createdProject.addTrackers(newTrackers);
assertEquals("trackers should be added to bean", 3, createdProject.getTrackers().size());
projectManager.update(createdProject);
createdProject=projectManager.getProjectByKey(createdProjectKey);
assertEquals("trackers should be added to redmine", 3, createdProject.getTrackers().size());
} finally {
if (createdProjectKey != null) {
projectManager.deleteProject(createdProjectKey);
}
}
}
Trackers can be added to a project object, however after calling projectManager.update the new trackers have not been added to Redmine.
It seems that java api tries to add tracker objects, but Redmine api requires an array of tracker ids. Some code to test this, latest assert fails when checking if Redmine has been updated