use of com.intellij.tasks.redmine.model.RedmineProject in project intellij-community by JetBrains.
the class RedmineRepository method fetchProjects.
public List<RedmineProject> fetchProjects() throws Exception {
HttpClient client = getHttpClient();
// Download projects with pagination (IDEA-125056, IDEA-125157)
List<RedmineProject> allProjects = new ArrayList<>();
int offset = 0;
ProjectsWrapper wrapper;
do {
HttpGet method = new HttpGet(getProjectsUrl(offset, 50));
wrapper = client.execute(method, new GsonSingleObjectDeserializer<>(GSON, ProjectsWrapper.class));
offset += wrapper.getProjects().size();
allProjects.addAll(wrapper.getProjects());
} while (wrapper.getTotalCount() > allProjects.size() || wrapper.getProjects().isEmpty());
myProjects = allProjects;
return Collections.unmodifiableList(myProjects);
}
use of com.intellij.tasks.redmine.model.RedmineProject in project intellij-community by JetBrains.
the class RedmineIntegrationTest method testIssueFilteringByProject.
public void testIssueFilteringByProject() throws Exception {
final List<RedmineProject> allProjects = myRepository.fetchProjects();
final RedmineProject project = ContainerUtil.find(allProjects, project1 -> project1.getName().equals("With-Minus"));
assertNotNull(project);
myRepository.setCurrentProject(project);
final Task[] issues = myRepository.getIssues("", 0, 10, false);
assertNotNull(issues);
assertEquals(1, issues.length);
assertEquals(issues[0].getSummary(), "This issue was created for project filtering tests. Do not change it.");
}
Aggregations