@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 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()); }