JToggl { public PagedResult getDetailedReport(PagedReportsParameter parameters) { String response = fetch(REPORTS_ENDPOINT + "/details?" + parameters.toParamList()); return new PagedResult(response); } 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 getDetailedReport() { PagedResult detailedReport = jToggl.getDetailedReport((PagedReportsParameter) new PagedReportsParameter(workspace.getId(), "jtoggl-integration-test") .setSince("2011-11-15") .setUntil("2011-11-15") .setProjectIds(Collections.singleton(project.getId()))); Optional<TimeEntry> entry = detailedReport.getEntries().stream().filter(e -> e.getDescription().equals("From JUnit Test")).findFirst(); Assert.assertTrue(entry.isPresent()); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm"); Assert.assertEquals(formatter.format(timeEntry.getStart()), formatter.format(entry.get().getStart())); Assert.assertEquals(formatter.format(timeEntry.getStop()), formatter.format(entry.get().getStop())); Assert.assertEquals(timeEntry.getId(), entry.get().getId()); }