@Test public void testStatusUpdate() { int taskId = 1; // status update String status = "IN_PROGRESS"; Task task = taskManager.readTask(taskId); task.setStatus(TaskStatus.valueOf(status)); User createdBy = userServiceManager.readUser(1); task.setCreatedByUser(createdBy); taskManager.updateTask(task); Task updatedTask = taskManager.readTask(taskId); assertEquals(TaskStatus.IN_PROGRESS, updatedTask.getStatus()); }
@Test public void testFetchTaskStatusSummary() { // by project Integer projectId = 1; Integer sprintId = null; List tasks = taskManager.fetchTaskStatusSummary(projectId, sprintId); assertNotNull(tasks); // debug(tasks); // by sprint sprintId = 1; tasks = taskManager.fetchTaskStatusSummary(projectId, sprintId); assertNotNull(tasks); // debug(tasks); }
@Test public void testTaskCreate() { String storyId = "1"; String username = "******"; String assignee = null; String timeInDays = "1"; String milestonePeriod = "1"; // fetch the task count and compare in the end of it succeeds- no method currently to get // the count or taskId Task task = new Task(); List<Task> result = new ArrayList<Task>(); try { User createdBy = userServiceManager.readUser(username); task.setContent("teste"); task.setCreatedByUser(createdBy); // if(milestonePeriod != null) task.setMilestonePeriod(milestonePeriod); // if(timeInDays != null) task.setTimeInDays(Integer.parseInt(timeInDays)); User assigneeUser = userServiceManager.readUser(assignee); if (assigneeUser != null) task.setUser(assigneeUser); // independent task support is ok if (storyId != null) task.setStory(storyManager.readStory(Integer.parseInt(storyId))); taskManager.createTask(task); } catch (Exception e) { e.printStackTrace(); // return result; } }
@Test public void testFetchTaskStatusDetails() { Integer projectId = 1; Integer sprintId = 1; Integer userId = null; Integer pageNum = 1; Integer pageSize = 10; String orderBy = "user.id"; // by project Id and sprintId List<Task> tasks = taskManager.fetchTaskStatusDetails(projectId, sprintId, userId, orderBy, pageNum, pageSize); assertNotNull(tasks); debug(tasks); // by user userId = 1; tasks = taskManager.fetchTaskStatusDetails(projectId, sprintId, userId, orderBy, pageNum, pageSize); assertNotNull(tasks); debug(tasks); }