@@ -202,15 +202,23 @@ public void testSprite() throws IOException {
202202
203203 @ Test
204204 public void testMulti () throws IOException {
205- cloudinary .uploader ().upload (SRC_TEST_IMAGE , asMap ("tags" , new String [] {"multi_test_tag" , SDK_TEST_TAG }, "public_id" , "multi_test_tag_1" ));
206- cloudinary .uploader ().upload (SRC_TEST_IMAGE , asMap ("tags" , new String [] {"multi_test_tag" , SDK_TEST_TAG }, "public_id" , "multi_test_tag_2" ));
207- Map result = cloudinary .uploader ().multi ("multi_test_tag" , asMap ("tags" , SDK_TEST_TAG , "transformation" , "c_crop,w_0.5" ));
205+ final String MULTI_TEST_TAG = "multi_test_tag" + SUFFIX ;
206+ final Map options = asMap ("tags" , new String []{MULTI_TEST_TAG , SDK_TEST_TAG , uniqueTag });
207+ cloudinary .uploader ().upload (SRC_TEST_IMAGE , options );
208+ cloudinary .uploader ().upload (SRC_TEST_IMAGE , options );
209+ List <String > ids = new ArrayList <String >();
210+ Map result = cloudinary .uploader ().multi (MULTI_TEST_TAG , asMap ("transformation" , "c_crop,w_0.5" ));
211+ ids .add ((String ) result .get ("public_id" ));
212+ Map pdfResult = cloudinary .uploader ().multi (MULTI_TEST_TAG , asMap ("transformation" , new Transformation ().width (111 ), "format" , "pdf" ));
213+ ids .add ((String ) pdfResult .get ("public_id" ));
214+ try {
215+ cloudinary .api ().deleteResources (ids , ObjectUtils .emptyMap ());
216+ } catch (Exception ignored ) {
217+ }
208218 assertTrue (((String ) result .get ("url" )).endsWith (".gif" ));
209- result = cloudinary .uploader ().multi ("multi_test_tag" , asMap ("transformation" , "w_100" ));
210- assertTrue (((String ) result .get ("url" )).contains ("w_100" ));
211- result = cloudinary .uploader ().multi ("multi_test_tag" , asMap ("transformation" , new Transformation ().width (111 ), "format" , "pdf" ));
212- assertTrue (((String ) result .get ("url" )).contains ("w_111" ));
213- assertTrue (((String ) result .get ("url" )).endsWith (".pdf" ));
219+ assertTrue (((String ) result .get ("url" )).contains ("w_0.5" ));
220+ assertTrue (((String ) pdfResult .get ("url" )).contains ("w_111" ));
221+ assertTrue (((String ) pdfResult .get ("url" )).endsWith (".pdf" ));
214222 }
215223
216224 @ Test
0 commit comments