Skip to content

Commit ff93e78

Browse files
author
Amir Tocker
committed
Make restore test run in parallel
1 parent f522c8c commit ff93e78

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

cloudinary-test-common/src/main/java/com/cloudinary/test/AbstractApiTest.java

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ abstract public class AbstractApiTest extends MockableTest {
4545
public static final String DELETE_TRANSFORMATION_NAME = "c_scale,l_text:Arial_60:" + SUFFIX + "_delete,w_100";
4646
public static final Transformation DELETE_TRANSFORMATION = new Transformation().width(100).crop("scale").overlay(new TextLayer().text(SUFFIX + "_delete").fontFamily("Arial").fontSize(60));
4747
public static final String TEST_KEY = "test-key" + SUFFIX;
48+
public static final String API_TEST_RESTORE = "api_test_restore" + SUFFIX;
4849

4950
protected Api api;
5051

@@ -708,18 +709,18 @@ public void testFolderApi() throws Exception {
708709
public void testRestore() throws Exception {
709710
// should support restoring resources
710711
cloudinary.uploader().upload(SRC_TEST_IMAGE,
711-
ObjectUtils.asMap("public_id", "api_test_restore", "backup", true, "tags", UPLOAD_TAGS));
712-
Map resource = api.resource("api_test_restore", ObjectUtils.emptyMap());
712+
ObjectUtils.asMap("public_id", API_TEST_RESTORE, "backup", true, "tags", UPLOAD_TAGS));
713+
Map resource = api.resource(API_TEST_RESTORE, ObjectUtils.emptyMap());
713714
assertEquals(resource.get("bytes"), 3381);
714-
api.deleteResources(Collections.singletonList("api_test_restore"), ObjectUtils.emptyMap());
715-
resource = api.resource("api_test_restore", ObjectUtils.emptyMap());
715+
api.deleteResources(Collections.singletonList(API_TEST_RESTORE), ObjectUtils.emptyMap());
716+
resource = api.resource(API_TEST_RESTORE, ObjectUtils.emptyMap());
716717
assertEquals(resource.get("bytes"), 0);
717718
assertTrue((Boolean) resource.get("placeholder"));
718-
Map response = api.restore(Collections.singletonList("api_test_restore"), ObjectUtils.emptyMap());
719-
Map info = (Map) response.get("api_test_restore");
719+
Map response = api.restore(Collections.singletonList(API_TEST_RESTORE), ObjectUtils.emptyMap());
720+
Map info = (Map) response.get(API_TEST_RESTORE);
720721
assertNotNull(info);
721722
assertEquals(info.get("bytes"), 3381);
722-
resource = api.resource("api_test_restore", ObjectUtils.emptyMap());
723+
resource = api.resource(API_TEST_RESTORE, ObjectUtils.emptyMap());
723724
assertEquals(resource.get("bytes"), 3381);
724725
}
725726

0 commit comments

Comments
 (0)