()
| 139 | } |
| 140 | |
| 141 | @Test |
| 142 | public void testPagination() throws IOException |
| 143 | { |
| 144 | String req = "{ \"data\": [ { \"gid\": 1 }],\"next_page\": {\"offset\": \"b\",\"path\": \"/tasks?project=1&limit=5&offset=b\",\"uri\": \"https://app.asana.com/api/1.0/tasks?project=1&limit=5&offset=b\"}}"; |
| 145 | dispatcher.registerResponse("GET", "http://app/projects/1/tasks?limit=5&offset=a").code(200).content(req); |
| 146 | |
| 147 | ResultBodyCollection<Task> result = client.tasks.findByProject("1") |
| 148 | .option("limit", 5).option("offset", "a") |
| 149 | .executeRaw(); |
| 150 | |
| 151 | assertEquals("1", result.data.get(0).gid); |
| 152 | assertEquals("b", result.nextPage.offset); |
| 153 | assertEquals("/tasks?project=1&limit=5&offset=b", result.nextPage.path); |
| 154 | assertEquals("https://app.asana.com/api/1.0/tasks?project=1&limit=5&offset=b", result.nextPage.uri); |
| 155 | } |
| 156 | |
| 157 | @Test |
| 158 | public void testAsanaChangeLogging() throws IOException |
nothing calls this directly
no test coverage detected