JToggl { public List<Task> getTasks() { List<Task> tasks = new ArrayList<Task>(); List<Workspace> workspaces = getWorkspaces(); for (Workspace workspace : workspaces) { List<Task> workspaceTasks = getActiveWorkspaceTasks(workspace.getId()); tasks.addAll(workspaceTasks); } return tasks; } JToggl(String apiToken);  JToggl(String user, String password); List<TimeEntry> getTimeEntries(); List<TimeEntry> getTimeEntries(Date startDate, Date endDate); TimeEntry getTimeEntry(Long id); TimeEntry getCurrentTimeEntry(); TimeEntry createTimeEntry(TimeEntry timeEntry); TimeEntry startTimeEntry(TimeEntry timeEntry); TimeEntry stopTimeEntry(TimeEntry timeEntry); TimeEntry updateTimeEntry(TimeEntry timeEntry); void destroyTimeEntry(Long id); void destroyProject(Long id); List<Workspace> getWorkspaces(); List<ch.simas.jtoggl.Client> getClients(); ch.simas.jtoggl.Client createClient(ch.simas.jtoggl.Client clientObject); ch.simas.jtoggl.Client updateClient(ch.simas.jtoggl.Client clientObject); void destroyClient(Long id); List<Project> getProjects(); Project createProject(Project project); Project updateProject(Project project); ProjectUser createProjectUser(ProjectUser projectUser); List<Task> getTasks(); Task createTask(Task task); Task updateTask(Task task); void destroyTask(Long id); User getCurrentUser(); User getCurrentUserWithRelatedData(); List<User> getWorkspaceUsers(long workspaceId); List<Project> getWorkspaceProjects(long workspaceId); List<ch.simas.jtoggl.Client> getWorkspaceClients(long workspaceId); List<Task> getActiveWorkspaceTasks(long workspaceId); List<User> getUsers(); PagedResult getDetailedReport(PagedReportsParameter parameters); void switchLoggingOn(); void switchLoggingOff(); long getThrottlePeriod(); void setThrottlePeriod(long throttlePeriod);  }
@Test public void getTasks() { boolean isPremium = false; List<Workspace> workspaces = jToggl.getWorkspaces(); if (!workspaces.isEmpty()) { isPremium = workspaces.get(0).getPremium(); } List<Task> tasks = jToggl.getTasks(); Assert.assertFalse(isPremium && tasks.isEmpty()); }