Skip to content

Commit c063e8c

Browse files
nitzanjAmir Tocker
authored andcommitted
Adapt ApiTest and ContextTest to parallel test runs.
1 parent 8c7032b commit c063e8c

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ abstract public class AbstractApiTest extends MockableTest {
3535
public static final String API_TEST_UPLOAD_PRESET_2 = API_TEST_UPLOAD_PRESET + "2";
3636
public static final String API_TEST_UPLOAD_PRESET_3 = API_TEST_UPLOAD_PRESET + "3";
3737
public static final String API_TEST_UPLOAD_PRESET_4 = API_TEST_UPLOAD_PRESET + "4";
38-
public static final String[] UPLOAD_TAGS = {SDK_TEST_TAG, uniqueTag};
38+
public static final String[] UPLOAD_TAGS = {SDK_TEST_TAG, SDK_TEST_TAG + "_api", uniqueTag};
3939
public static final String EXPLICIT_TRANSFORMATION_NAME = "c_scale,l_text:Arial_60:" + SUFFIX + ",w_100";
4040
public static final Transformation EXPLICIT_TRANSFORMATION = new Transformation().width(100).crop("scale").overlay(new TextLayer().text(SUFFIX).fontFamily("Arial").fontSize(60));
4141
public static final String TEST_KEY = "test-key" + SUFFIX;
@@ -49,17 +49,17 @@ public static void setUpClass() throws IOException {
4949
System.err.println("Please setup environment for Upload test to run");
5050
return;
5151
}
52-
Map options = ObjectUtils.asMap("public_id", API_TEST, "tags", new String[]{SDK_TEST_TAG, uniqueTag}, "context", "key=value", "eager",
52+
Map options = ObjectUtils.asMap("public_id", API_TEST, "tags", UPLOAD_TAGS, "context", "key=value", "eager",
5353
Collections.singletonList(EXPLICIT_TRANSFORMATION));
5454
cloudinary.uploader().upload(SRC_TEST_IMAGE, options);
5555
options.put("public_id", API_TEST_1);
5656
cloudinary.uploader().upload(SRC_TEST_IMAGE, options);
5757

5858
String context1 = TEST_KEY + "=alt";
5959
String context2 = TEST_KEY + "=alternate";
60-
options = ObjectUtils.asMap("public_id", "context_1" + SUFFIX, "tags", new String[]{SDK_TEST_TAG, uniqueTag}, "context", context1);
60+
options = ObjectUtils.asMap("public_id", "context_1" + SUFFIX, "tags", UPLOAD_TAGS, "context", context1);
6161
cloudinary.uploader().upload(SRC_TEST_IMAGE, options);
62-
options = ObjectUtils.asMap("public_id", "context_2" + SUFFIX, "tags", new String[]{SDK_TEST_TAG, uniqueTag}, "context", context2);
62+
options = ObjectUtils.asMap("public_id", "context_2" + SUFFIX, "tags", UPLOAD_TAGS, "context", context2);
6363
cloudinary.uploader().upload(SRC_TEST_IMAGE, options);
6464
}
6565

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
@SuppressWarnings({"rawtypes", "unchecked"})
2222
abstract public class AbstractContextTest extends MockableTest {
2323

24-
private static final String CONTEXT_TAG = "context_tag_" + String.valueOf(System.currentTimeMillis());
24+
private static final String CONTEXT_TAG = "context_tag_" + String.valueOf(System.currentTimeMillis()) + SUFFIX;
2525
private static Map resource;
2626
public static final Map CONTEXT = asMap("caption", "some cäption", "alt", "alternativè");
2727
private Uploader uploader;

0 commit comments

Comments
 (0)