@Test public void testResourcesByPublicIds() throws Exception { // should allow listing resources by public ids Map result = api.resourcesByIds( Arrays.asList("api_test", "api_test1", "bogus"), Cloudinary.asMap("type", "upload", "tags", true, "context", true)); List<Map> resources = (List<Map>) result.get("resources"); assertEquals(2, resources.size()); assertNotNull(findByAttr(resources, "public_id", "api_test")); assertNotNull(findByAttr(resources, "public_id", "api_test1")); assertNotNull( findByAttr( (List<Map>) result.get("resources"), "context", Cloudinary.asMap("custom", Cloudinary.asMap("key", "value")))); boolean found = false; for (Map r : resources) { org.json.simple.JSONArray tags = (org.json.simple.JSONArray) r.get("tags"); found = found || tags.contains("api_test_tag"); } assertTrue(found); }