示例#1
0
 @Test
 public void test14TransformationUpdate() throws Exception {
   // should allow updating transformation allowed_for_strict
   api.updateTransformation(
       "c_scale,w_100", Cloudinary.asMap("allowed_for_strict", true), Cloudinary.emptyMap());
   Map transformation = api.transformation("c_scale,w_100", Cloudinary.emptyMap());
   assertNotNull(transformation);
   assertEquals(transformation.get("allowed_for_strict"), true);
   api.updateTransformation(
       "c_scale,w_100", Cloudinary.asMap("allowed_for_strict", false), Cloudinary.emptyMap());
   transformation = api.transformation("c_scale,w_100", Cloudinary.emptyMap());
   assertNotNull(transformation);
   assertEquals(transformation.get("allowed_for_strict"), false);
 }
示例#2
0
 @Test
 public void test15aTransformationUnsafeUpdate() throws Exception {
   // should allow unsafe update of named transformation
   api.createTransformation(
       "api_test_transformation3",
       new Transformation().crop("scale").width(102).generate(),
       Cloudinary.emptyMap());
   api.updateTransformation(
       "api_test_transformation3",
       Cloudinary.asMap("unsafe_update", new Transformation().crop("scale").width(103).generate()),
       Cloudinary.emptyMap());
   Map transformation = api.transformation("api_test_transformation3", Cloudinary.emptyMap());
   assertNotNull(transformation);
   assertEquals(
       new Transformation((List<Map>) transformation.get("info")).generate(),
       new Transformation().crop("scale").width(103).generate());
   assertEquals(transformation.get("used"), false);
 }