@@ -49,6 +49,8 @@ abstract public class AbstractApiTest extends MockableTest {
4949 public static final Set <String > createdFolders = new HashSet <String >();
5050 private static final String CUSTOM_USER_AGENT_PREFIX = "TEST_USER_AGENT" ;
5151 private static final String CUSTOM_USER_AGENT_VERSION = "9.9.9" ;
52+ private static String assetId1 ;
53+ private static String assetId2 ;
5254
5355
5456 protected Api api ;
@@ -66,10 +68,10 @@ public static void setUpClass() throws IOException {
6668
6769 Map options = ObjectUtils .asMap ("public_id" , API_TEST , "tags" , uploadAndDirectionTag , "context" , "key=value" , "eager" ,
6870 Collections .singletonList (EXPLICIT_TRANSFORMATION ));
69- cloudinary .uploader ().upload (SRC_TEST_IMAGE , options );
71+ assetId1 = cloudinary .uploader ().upload (SRC_TEST_IMAGE , options ). get ( "asset_id" ). toString ( );
7072
7173 options .put ("public_id" , API_TEST_1 );
72- cloudinary .uploader ().upload (SRC_TEST_IMAGE , options );
74+ assetId2 = cloudinary .uploader ().upload (SRC_TEST_IMAGE , options ). get ( "asset_id" ). toString ( );
7375 options .remove ("public_id" );
7476
7577 options .put ("eager" , Collections .singletonList (UPDATE_TRANSFORMATION ));
@@ -269,6 +271,15 @@ public void testTransformationsWithCursor() throws Exception {
269271 assertThat (transformations , hasItem (allOf (hasEntry ("name" , "t_" + name ))));
270272 }
271273
274+ @ Test
275+ public void testResourcesByAssetIds () throws Exception {
276+ Map result = api .resourcesByAssetIDs (Arrays .asList (assetId1 , assetId2 ), ObjectUtils .asMap ("tags" , true , "context" , true ));
277+ List <Map > resources = (List <Map >) result .get ("resources" );
278+ assertEquals (2 , resources .size ());
279+ assertNotNull (findByAttr (resources , "public_id" , API_TEST ));
280+ assertNotNull (findByAttr (resources , "public_id" , API_TEST_1 ));
281+ }
282+
272283 @ Test
273284 public void testResourcesByPublicIds () throws Exception {
274285 // should allow listing resources by public ids
0 commit comments