@@ -327,28 +327,29 @@ public void test09DeleteResources() throws Exception {
327327 cloudinary .uploader ().upload (SRC_TEST_IMAGE , ObjectUtils .asMap ("public_id" , public_id , "tags" , UPLOAD_TAGS ));
328328 Map resource = api .resource (public_id , ObjectUtils .emptyMap ());
329329 assertNotNull (resource );
330- api .deleteResources (Arrays .asList (API_TEST_2 , public_id ), ObjectUtils .emptyMap ());
330+ api .deleteResources (Arrays .asList (public_id ), ObjectUtils .emptyMap ());
331331 api .resource (public_id , ObjectUtils .emptyMap ());
332332 }
333333
334334 @ Test (expected = NotFound .class )
335335 public void test09aDeleteResourcesByPrefix () throws Exception {
336336 // should allow deleting resources
337- cloudinary .uploader ().upload (SRC_TEST_IMAGE , ObjectUtils .asMap ("public_id" , "api_test_by_prefix" , "tags" , UPLOAD_TAGS ));
338- Map resource = api .resource ("api_test_by_prefix" , ObjectUtils .emptyMap ());
337+ String public_id = SUFFIX + "_api_test_by_prefix" ;
338+ cloudinary .uploader ().upload (SRC_TEST_IMAGE , ObjectUtils .asMap ("public_id" , public_id , "tags" , UPLOAD_TAGS ));
339+ Map resource = api .resource (public_id , ObjectUtils .emptyMap ());
339340 assertNotNull (resource );
340- api .deleteResourcesByPrefix ("api_test_by" , ObjectUtils .emptyMap ());
341- api .resource ("api_test_by_prefix" , ObjectUtils .emptyMap ());
341+ api .deleteResourcesByPrefix (public_id . substring ( 0 , SUFFIX . length () + 10 ) , ObjectUtils .emptyMap ());
342+ api .resource (public_id , ObjectUtils .emptyMap ());
342343 }
343344
344345 @ Test (expected = NotFound .class )
345346 public void test09aDeleteResourcesByTags () throws Exception {
346347 // should allow deleting resources
347- cloudinary . uploader (). upload ( SRC_TEST_IMAGE ,
348- ObjectUtils .asMap ("public_id" , API_TEST + "_4" , "tags" , Collections .singletonList ("api_test_tag_for_delete" )));
348+ String tag = "api_test_tag_for_delete" + SUFFIX ;
349+ cloudinary . uploader (). upload ( SRC_TEST_IMAGE , ObjectUtils .asMap ("public_id" , API_TEST + "_4" , "tags" , Collections .singletonList (tag )));
349350 Map resource = api .resource (API_TEST + "_4" , ObjectUtils .emptyMap ());
350351 assertNotNull (resource );
351- api .deleteResourcesByTag ("api_test_tag_for_delete" , ObjectUtils .emptyMap ());
352+ api .deleteResourcesByTag (tag , ObjectUtils .emptyMap ());
352353 api .resource (API_TEST + "_4" , ObjectUtils .emptyMap ());
353354 }
354355
0 commit comments