JToggl { public Project updateProject(Project project) { String url = PROJECT_BY_ID.replace(PLACEHOLDER, project.getId().toString()); JSONObject object = createProjectRequestParameter(project); String response = getClient().body(object.toJSONString()).put(url).body().asString(); object = (JSONObject) JSONValue.parse(response); JSONObject data = (JSONObject) object.get(DATA); return new Project(data.toJSONString()); } 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 updateProject() { project.setBillable(true); Project pr = jToggl.updateProject(project); Assert.assertNotNull(pr); Assert.assertTrue(pr.isBillable()); }