@@ -394,51 +394,39 @@ public void testSpriteCss() {
394394 assertEquals ("http://res.cloudinary.com/test123/image/sprite/test.css" , result );
395395 }
396396
397- @ SuppressWarnings ("unchecked" )
398- @ Test
399- public void testEscapePublicId () {
400- // should escape public_ids
401- Map <String , String > tests = Cloudinary .asMap (
402- "a b" , "a%20b" ,
403- "a+b" , "a%2Bb" ,
404- "a%20b" , "a%20b" ,
405- "a-b" , "a-b" ,
406- "a??b" , "a%3F%3Fb" );
407- for (Map .Entry <String , String > entry : tests .entrySet ()) {
408- String result = cloudinary .url ().generate (entry .getKey ());
409- assertEquals ("http://res.cloudinary.com/test123/image/upload/" + entry .getValue (), result );
397+ @ SuppressWarnings ("unchecked" )
398+ @ Test
399+ public void testEscapePublicId () {
400+ // should escape public_ids
401+ Map <String , String > tests = Cloudinary .asMap ("a b" , "a%20b" , "a+b" , "a%2Bb" , "a%20b" , "a%20b" , "a-b" , "a-b" , "a??b" , "a%3F%3Fb" );
402+ for (Map .Entry <String , String > entry : tests .entrySet ()) {
403+ String result = cloudinary .url ().generate (entry .getKey ());
404+ assertEquals ("http://res.cloudinary.com/test123/image/upload/" + entry .getValue (), result );
410405 }
411- }
412-
413- @ Test
414- public void testSignedUrl () {
415- // should correctly sign a url
416- String expected = "http://res.cloudinary.com/test123/image/upload/s--MaRXzoEC--/c_crop,h_20,w_10/v1234/image.jpg" ;
417- String actual = cloudinary .url ().version (1234 ).
418- transformation (new Transformation ().crop ("crop" ).width (10 ).height (20 )).
419- signed (true ).
420- generate ("image.jpg" );
421- assertEquals (expected , actual );
422-
423- expected = "http://res.cloudinary.com/test123/image/upload/s--ZlgFLQcO--/v1234/image.jpg" ;
424- actual = cloudinary .url ().version (1234 ).
425- signed (true ).
426- generate ("image.jpg" );
427- assertEquals (expected , actual );
428-
429- expected = "http://res.cloudinary.com/test123/image/upload/s--Ai4Znfl3--/c_crop,h_20,w_10/image.jpg" ;
430- actual = cloudinary .url ().
431- transformation (new Transformation ().crop ("crop" ).width (10 ).height (20 )).
432- signed (true ).
433- generate ("image.jpg" );
434- assertEquals (expected , actual );
435- }
436-
437- public void testUtils () {
438- assertEquals (Cloudinary .asBoolean (true , null ), true );
439- assertEquals (Cloudinary .asBoolean (false , null ), false );
440- }
441-
406+ }
407+
408+ @ Test
409+ public void testSignedUrl () {
410+ // should correctly sign a url
411+ String expected = "http://res.cloudinary.com/test123/image/upload/s--MaRXzoEC--/c_crop,h_20,w_10/v1234/image.jpg" ;
412+ String actual = cloudinary .url ().version (1234 ).transformation (new Transformation ().crop ("crop" ).width (10 ).height (20 )).signed (true )
413+ .generate ("image.jpg" );
414+ assertEquals (expected , actual );
415+
416+ expected = "http://res.cloudinary.com/test123/image/upload/s--ZlgFLQcO--/v1234/image.jpg" ;
417+ actual = cloudinary .url ().version (1234 ).signed (true ).generate ("image.jpg" );
418+ assertEquals (expected , actual );
419+
420+ expected = "http://res.cloudinary.com/test123/image/upload/s--Ai4Znfl3--/c_crop,h_20,w_10/image.jpg" ;
421+ actual = cloudinary .url ().transformation (new Transformation ().crop ("crop" ).width (10 ).height (20 )).signed (true ).generate ("image.jpg" );
422+ assertEquals (expected , actual );
423+ }
424+
425+ public void testUtils () {
426+ assertEquals (Cloudinary .asBoolean (true , null ), true );
427+ assertEquals (Cloudinary .asBoolean (false , null ), false );
428+ }
429+
442430 public static Map <String , String > getUrlParameters (URI uri ) throws UnsupportedEncodingException {
443431 Map <String , String > params = new HashMap <String , String >();
444432 for (String param : uri .getQuery ().split ("&" )) {
0 commit comments