Skip to content

Commit c89c404

Browse files
nitzanjtocker
authored andcommitted
Add test for listing transformations with cursor.
1 parent 62a5341 commit c89c404

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

cloudinary-test-common/src/main/java/com/cloudinary/test/AbstractApiTest.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,20 @@ public void testResourcesListingStartAt() throws Exception {
240240
assertEquals(response.get("public_id"), resources.get(0).get("public_id"));
241241
}
242242

243+
@Test
244+
public void testTransformationsWithCursor() throws Exception {
245+
String name = "testTransformation" + SDK_TEST_TAG;
246+
api.createTransformation(name, "c_scale,w_100", null);
247+
final List<Map> transformations = new ArrayList<>();
248+
String next_cursor = null;
249+
do {
250+
Map result = api.transformations(ObjectUtils.asMap("max_results", 500, "next_cursor", next_cursor));
251+
transformations.addAll((List) result.get("transformations"));
252+
next_cursor = (String) result.get("next_cursor");
253+
} while (next_cursor != null );
254+
assertThat(transformations, hasItem(allOf(hasEntry("name", "t_" + name))));
255+
}
256+
243257
@Test
244258
public void testResourcesByPublicIds() throws Exception {
245259
// should allow listing resources by public ids

0 commit comments

Comments
 (0)