MCPcopy Create free account
hub / github.com/Asana/java-asana / testPagination

Method testPagination

src/test/java/com/asana/ClientTest.java:141–155  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 7

contentMethod · 0.80
codeMethod · 0.80
registerResponseMethod · 0.80
getMethod · 0.80
executeRawMethod · 0.45
optionMethod · 0.45
findByProjectMethod · 0.45

Tested by

no test coverage detected