@Test public void addNewTasks() { for (int i = 0; i < MAX_TASKS; i++) { TodoTask task = new TodoTask(); task.setDescription("Unit Test - Sample #".concat(String.valueOf(i))); todoService.addTask(task); task = null; } List<TodoTask> tasks = todoService.getAllOpenTasks(); Assert.assertEquals(tasks.size(), MAX_TASKS, "Incorrect # of tasks"); }
@Test(dependsOnMethods = "addNewTasks") public void findAllTasks() { List<TodoTask> tasks = todoService.getAllTasks(); Assert.assertFalse(tasks.isEmpty()); }