@@ -149,11 +149,11 @@ public void testRename() throws Exception {
149149 public void testExplicit () throws Exception {
150150 if (cloudinary .config .apiSecret == null )
151151 return ;
152- JSONObject result = new JSONObject (cloudinary .uploader ().explicit ("cloudinary " ,
153- ObjectUtils .asMap ("eager" , Collections .singletonList (new Transformation ().crop ("scale" ).width (2.0 )), "type" , "twitter_name " )));
154- String url = cloudinary .url ().type ( "twitter_name" ). transformation (new Transformation ().crop ("scale" ).width (2.0 )).format ("png " )
155- .version (result .get ("version" )).generate ("cloudinary " );
156- assertEquals (result .getJSONArray ("eager" ).getJSONObject (0 ).get ("url" ), url );
152+ JSONObject result = new JSONObject (cloudinary .uploader ().explicit ("sample " ,
153+ ObjectUtils .asMap ("eager" , Collections .singletonList (new Transformation ().crop ("scale" ).width (2.0 )), "type" , "upload " )));
154+ String url = cloudinary .url ().transformation (new Transformation ().crop ("scale" ).width (2.0 )).format ("jpg " )
155+ .version (result .get ("version" )).generate ("sample " );
156+ assertEquals (url , result .getJSONArray ("eager" ).getJSONObject (0 ).get ("url" ));
157157 }
158158
159159 public void testEager () throws Exception {
@@ -293,7 +293,7 @@ public void testCategorizationRequest() {
293293 try {
294294 cloudinary .uploader ().upload (getAssetStream (TEST_IMAGE ), ObjectUtils .asMap ("categorization" , "illegal" ));
295295 } catch (Exception e ) {
296- assertTrue (e .getMessage ().matches (".*illegal is not a valid.* " ));
296+ assertTrue (e .getMessage ().matches ("(.*)(Illegal value| not a valid|invalid)(.*) " ));
297297 }
298298 }
299299
@@ -304,7 +304,7 @@ public void testDetectionRequest() {
304304 try {
305305 cloudinary .uploader ().upload (getAssetStream (TEST_IMAGE ), ObjectUtils .asMap ("detection" , "illegal" ));
306306 } catch (Exception e ) {
307- assertTrue (e .getMessage ().matches (".*illegal is not a valid.*" ));
307+ assertTrue (e .getMessage ().matches (".*(Illegal value| not a valid|invalid) .*" ));
308308 }
309309 }
310310
0 commit comments