-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAssetLinkTest.java
More file actions
28 lines (22 loc) · 1.04 KB
/
AssetLinkTest.java
File metadata and controls
28 lines (22 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package com.contentstack.utils;
import com.contentstack.utils.render.DefaultOption;
import org.json.JSONObject;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
import java.io.IOException;
public class AssetLinkTest {
private static JSONObject assetLink = null;
@BeforeClass
public static void startUtilTests() throws IOException {
final String ASSERT_LINK = "src/test/resources/issue/jsonfile.json";
assetLink = new ReadResource().readJson(ASSERT_LINK);
}
@Test
public void testRenderFunction() {
String[] keys = new String[1];
keys[0] = "assetlink";
Utils.jsonToHTML(assetLink, keys, new DefaultOption());
Assert.assertEquals("<img display-type=\"display\" asset-name=\"11.jpg\" asset-type=\"image/jpeg\" asset-uid=\"asset_uid_1\" width=\"25.16914749661705\" className=\"dsd\" id=\"sdf\" type=\"asset\" content-type-uid=\"sys_assets\" class-name=\"embedded-asset\" src=\"https://image.url/11.jpg\" />", assetLink.opt("assetlink").toString());
}
}