diff --git a/kp_service_test/src/test/java/org/sunbird/kp/test/common/BaseCitrusTestRunner.java b/kp_service_test/src/test/java/org/sunbird/kp/test/common/BaseCitrusTestRunner.java index dac673ee..316a19d8 100644 --- a/kp_service_test/src/test/java/org/sunbird/kp/test/common/BaseCitrusTestRunner.java +++ b/kp_service_test/src/test/java/org/sunbird/kp/test/common/BaseCitrusTestRunner.java @@ -27,6 +27,7 @@ public class BaseCitrusTestRunner extends TestNGCitrusTestRunner { public static final String REQUEST_JSON = "request.json"; public static final String RESPONSE_JSON = "response.json"; public static final String VALIDATE_JSON = "validate.json"; + public static final String RESPONSE_JSON_IMAGE = "response_image.json"; private static final String API_KEY = AppConfig.config.getString("kp_api_key"); private static final Boolean IS_USER_AUTH_REQUIRED = AppConfig.config.getBoolean("user_auth_enable"); diff --git a/kp_service_test/src/test/java/org/sunbird/kp/test/content/v3/ContentV3Scenario.java b/kp_service_test/src/test/java/org/sunbird/kp/test/content/v3/ContentV3Scenario.java index bad600d5..9a0d80cd 100644 --- a/kp_service_test/src/test/java/org/sunbird/kp/test/content/v3/ContentV3Scenario.java +++ b/kp_service_test/src/test/java/org/sunbird/kp/test/content/v3/ContentV3Scenario.java @@ -462,6 +462,22 @@ public class ContentV3Scenario { public static final String TEST_UPDATE_HIERARCHY_WITH_1RESOURCE_ONLY = "testUpdateHierarchyWith1ResourceOnly"; public static final String TEST_UPDATE_HIERARCHY_WITH_MULTILEVEL_UNITS = "testUpdateHierarchyWithMultilevelUnitAnd1Resource"; public static final String TEST_UPDATE_HIERARCHY_WITH_1UNIT_1COLLECTION = "testUpdateHierarchyWith1Unit1CollectionValidRequest"; - + //Get Hierarchy Scenarios + public static final String TEST_GET_HIERARCHY_WITH_VALID_IDENTIFIER = "testGetHierarchyWithValidIdentifier"; + public static final String TEST_GET_HIERARCHY_WITH_INVALID_IDENTIFIER = "testGetHierarchyWithInvalidIdentifier"; + public static final String TEST_GET_HIERARCHY_WITH_EDIT_MODE = "testGetHierarchyWithEditMode"; + public static final String TEST_GET_HIERARCHY_WITH_NULL_MODE = "testGetHierarchyWithNullMode"; + public static final String TEST_GET_HIERARCHY_WITH_INVALID_MODE = "testGetHierarchyWithInvalidMode"; + public static final String TEST_GET_HIERARCHY_WITH_EMPTY_MODE = "testGetHierarchyWithEmptyMode"; + public static final String TEST_GET_HIERARCHY_BEFORE_UPDATE = "testGetHierarchyBeforeUpdate"; + public static final String TEST_GET_HIERARCHY_AFTER_UPDATE = "testGetHierarchyAfterUpdate"; + public static final String TEST_GET_HIERARCHY_AFTER_REVIEW = "testGetHierarchyAfterReview"; + public static final String TEST_GET_HIERARCHY_AFTER_REJECT = "testGetHierarchyAfterReject"; + public static final String TEST_GET_HIERARCHY_AFTER_FLAG = "testGetHierarchyAfterFlag"; + public static final String TEST_GET_HIERARCHY_AFTER_FLAG_REJECT = "testGetHierarchyAfterFlagReject"; + public static final String TEST_GET_HIERARCHY_AFTER_FLAG_ACCEPT = "testGetHierarchyAfterFlagAccept"; + public static final String TEST_GET_HIERARCHY_AFTER_DISCARD = "testGetHierarchyAfterDiscard"; + public static final String TEST_GET_HIERARCHY_AFTER_RETIRE = "testGetHierarchyAfterRetire"; + public static final String TEST_GET_HIERARCHY_AFTER_UPDATE_LIVE = "testGetHierarchyAfterUpdateLive"; } diff --git a/kp_service_test/src/test/java/org/sunbird/kp/test/content/v3/getHierarchyTest.java b/kp_service_test/src/test/java/org/sunbird/kp/test/content/v3/getHierarchyTest.java new file mode 100644 index 00000000..4926cc08 --- /dev/null +++ b/kp_service_test/src/test/java/org/sunbird/kp/test/content/v3/getHierarchyTest.java @@ -0,0 +1,266 @@ +package org.sunbird.kp.test.content.v3; + +import com.consol.citrus.annotations.CitrusTest; +import com.consol.citrus.testng.CitrusParameters; +import org.springframework.http.HttpStatus; +import org.sunbird.kp.test.common.APIUrl; +import org.sunbird.kp.test.common.BaseCitrusTestRunner; +import org.sunbird.kp.test.util.CollectionUtil; +import org.sunbird.kp.test.util.CollectionUtilPayload; +import org.sunbird.kp.test.util.ContentUtil; +import org.sunbird.kp.test.util.TestSetupUtil; +import org.testng.annotations.AfterClass; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +import java.util.HashMap; +import java.util.Map; + +/** + * Integration Test Cases for Get Hierarchy API + * + * @author Neha Verma + * + * Number of testcases for get : 16 + * Last Count Update: 17-12-2019 + */ +public class getHierarchyTest extends BaseCitrusTestRunner { + + private static final String TEMPLATE_DIR = "templates/content/v3/hierarchy/get"; + private static final String MODE = "?mode="; + private String identifier; + private static Map dirIdMap = new HashMap<>(); + + @AfterClass + public static void populateAssertionData() { + // TestSetupUtil.createDirectoriesForTestCases(dirIdMap, "response.json", TEMPLATE_DIR); + TestSetupUtil.createDirectoriesForTestCases(dirIdMap, "response_image.json", TEMPLATE_DIR); + } + + @Test(dataProvider = "getHierarchyWithValidRequest") + @CitrusParameters ({"testName", "workFlowStatus", "payload", "collectionType", "resourceCount"}) + @CitrusTest + public void getHierarchyWithValidRequest(String testName, String workFlowStatus, String payload, String collectionType, Integer resourceCount) { + Map collectionMap = CollectionUtil.prepareTestCollection(workFlowStatus, this, new HashMap() {{put("updateHierarchy", payload);}}, collectionType, 0, resourceCount, "application/vnd.ekstep.ecml-archive"); + identifier = (String) collectionMap.get("content_id"); + this.variable("rootId", identifier); + performGetTest( + this, + TEMPLATE_DIR, + testName, + APIUrl.READ_CONTENT_HIERARCHY + identifier, + null, + HttpStatus.OK, + null, + RESPONSE_JSON + ); + } + + @Test(dataProvider = "getHierarchyWithInvalidRequest") + @CitrusParameters ({"testName", "workFlowStatus", "payload", "collectionType", "resourceCount", "rootId"}) + @CitrusTest + public void getHierarchyWithInvalidRequest(String testName, String workFlowStatus, String payload, String collectionType, Integer resourceCount, String rootId) { + Map collectionMap = CollectionUtil.prepareTestCollection(workFlowStatus, this, + new HashMap() {{put("updateHierarchy", payload);}}, collectionType, 0, resourceCount, "application/vnd.ekstep.ecml-archive"); + identifier = (String) collectionMap.get("content_id"); + //ContentUtil.publishContent(this, null, "public", identifier, null); + performGetTest( + this, + TEMPLATE_DIR, + testName, + APIUrl.READ_CONTENT_HIERARCHY + rootId, + null, + HttpStatus.NOT_FOUND, + null, + RESPONSE_JSON + ); + } + + @Test(dataProvider = "getHierarchyWithMode") + @CitrusParameters ({"testName", "workFlowStatus", "payload", "collectionType", "resourceCount", "mode"}) + @CitrusTest + public void getHierarchyWithMode(String testName, String workFlowStatus, String payload, String collectionType, Integer resourceCount, String mode) { + Map collectionMap = CollectionUtil.prepareTestCollection(workFlowStatus, this, + new HashMap() {{put("updateHierarchy", payload);}}, collectionType, 0, resourceCount, "application/vnd.ekstep.ecml-archive"); + identifier = (String) collectionMap.get("content_id"); + this.variable("rootId", identifier); + //dirIdMap.put(testName, identifier); + performGetTest( + this, + TEMPLATE_DIR, + testName, + APIUrl.READ_CONTENT_HIERARCHY + identifier + MODE + mode, + null, + HttpStatus.OK, + null, + RESPONSE_JSON + ); + } + + @Test(dataProvider = "getHierarchyLiveAndImageNodes") + @CitrusParameters ({"testName", "workFlowStatus", "payload", "collectionType", "resourceCount"}) + @CitrusTest + public void getHierarchyLiveAndImageNodes(String testName, String workFlowStatus, String payload, String collectionType, Integer resourceCount) { + Map collectionMap = CollectionUtil.prepareTestCollection(workFlowStatus, this, + new HashMap() {{put("updateHierarchy", payload);}}, collectionType, 0, resourceCount, "application/vnd.ekstep.ecml-archive"); + identifier = (String) collectionMap.get("content_id"); + this.variable("rootId", identifier); + // dirIdMap.put(testName, identifier); +// performGetTest( +// this, +// TEMPLATE_DIR, +// testName, +// APIUrl.READ_CONTENT_HIERARCHY + identifier, +// null, +// HttpStatus.OK, +// null, +// RESPONSE_JSON +// ); + performGetTest( + this, + TEMPLATE_DIR, + testName, + APIUrl.READ_CONTENT_HIERARCHY + identifier + MODE + "edit", + null, + HttpStatus.OK, + null, + RESPONSE_JSON_IMAGE + ); + } + + @Test(dataProvider = "getHierarchyImageNodes") + @CitrusParameters ({"testName", "workFlowStatus", "payload", "collectionType", "resourceCount"}) + @CitrusTest + public void getHierarchyImageNodes(String testName, String workFlowStatus, String payload, String collectionType, Integer resourceCount) { + Map collectionMap = CollectionUtil.prepareTestCollection(workFlowStatus, this, + new HashMap() {{put("updateHierarchy", payload);}}, collectionType, 0, resourceCount, "application/vnd.ekstep.ecml-archive"); + identifier = (String) collectionMap.get("content_id"); + this.variable("rootId", identifier); + // dirIdMap.put(testName, identifier); +// performGetTest( +// this, +// TEMPLATE_DIR, +// testName, +// APIUrl.READ_CONTENT_HIERARCHY + identifier, +// null, +// HttpStatus.NOT_FOUND, +// null, +// RESPONSE_JSON +// ); + performGetTest( + this, + TEMPLATE_DIR, + testName, + APIUrl.READ_CONTENT_HIERARCHY + identifier + MODE + "edit", + null, + HttpStatus.OK, + null, + RESPONSE_JSON_IMAGE + ); + } + + @Test + @CitrusTest + public void getHierarchyAfterReview(){ + Map collectionMap = CollectionUtil.prepareTestCollection("collectionReview", this, + new HashMap() {{put("updateHierarchy", CollectionUtilPayload.UPDATE_HIERARCHY_1_UNIT_1_RESOURCE);}}, "textBook", 0, 1, "application/vnd.ekstep.ecml-archive"); + identifier = (String) collectionMap.get("content_id"); + this.variable("rootId", identifier); + performGetTest( + this, + TEMPLATE_DIR, + ContentV3Scenario.TEST_GET_HIERARCHY_AFTER_REVIEW, + APIUrl.READ_CONTENT_HIERARCHY + identifier, + null, + HttpStatus.NOT_FOUND, + null, + RESPONSE_JSON + ); + performGetTest( + this, + TEMPLATE_DIR, + ContentV3Scenario.TEST_GET_HIERARCHY_AFTER_REVIEW, + APIUrl.READ_CONTENT_HIERARCHY + identifier + MODE + "edit", + null, + HttpStatus.OK, + null, + RESPONSE_JSON_IMAGE + ); + } + + + @DataProvider + public static Object[][] getHierarchyWithValidRequest() { + return new Object[][]{ + new Object[]{ + ContentV3Scenario.TEST_GET_HIERARCHY_WITH_VALID_IDENTIFIER, "collectionUnitsInLive", CollectionUtilPayload.UPDATE_HIERARCHY_1_UNIT_1_RESOURCE, "textBook", 1, true + } + }; + } + + @DataProvider + public static Object[][] getHierarchyWithInvalidRequest() { + return new Object[][]{ + new Object[]{ + ContentV3Scenario.TEST_GET_HIERARCHY_WITH_INVALID_IDENTIFIER, "collectionUnitsInLive", CollectionUtilPayload.UPDATE_HIERARCHY_1_UNIT_1_RESOURCE, "textBook", 1, "KP_FT_9876543" + } + }; + } + + @DataProvider + public static Object[][] getHierarchyWithMode() { + return new Object[][]{ + new Object[]{ + ContentV3Scenario.TEST_GET_HIERARCHY_WITH_EDIT_MODE, "collectionUnitsInDraft", CollectionUtilPayload.UPDATE_HIERARCHY_1_UNIT_1_RESOURCE, "textBook", 1, "edit" + }, + new Object[]{ + ContentV3Scenario.TEST_GET_HIERARCHY_WITH_EMPTY_MODE, "collectionUnitsInLive", CollectionUtilPayload.UPDATE_HIERARCHY_1_UNIT_1_RESOURCE, "textBook", 1, "" + }, + new Object[]{ + ContentV3Scenario.TEST_GET_HIERARCHY_WITH_INVALID_MODE, "collectionUnitsInLive", CollectionUtilPayload.UPDATE_HIERARCHY_1_UNIT_1_RESOURCE, "textBook", 1, "abc" + }, + new Object[]{ + ContentV3Scenario.TEST_GET_HIERARCHY_WITH_NULL_MODE, "collectionUnitsInLive", CollectionUtilPayload.UPDATE_HIERARCHY_1_UNIT_1_RESOURCE, "textBook", 1, null + } + }; + } + + @DataProvider + public static Object[][] getHierarchyLiveAndImageNodes() { + return new Object[][]{ +// new Object[]{ +// ContentV3Scenario.TEST_GET_HIERARCHY_AFTER_RETIRE, "collectionRetire", CollectionUtilPayload.UPDATE_HIERARCHY_1_UNIT_1_RESOURCE, "textBook", 1 +// }, +// new Object[]{ +// ContentV3Scenario.TEST_GET_HIERARCHY_AFTER_FLAG, "collectionInFlagged", CollectionUtilPayload.UPDATE_HIERARCHY_1_UNIT_1_RESOURCE, "textBook", 1 +// } +// //, +// new Object[]{ +// ContentV3Scenario.TEST_GET_HIERARCHY_AFTER_FLAG_ACCEPT, "contentInFlagDraft", CollectionUtilPayload.UPDATE_HIERARCHY_1_UNIT_1_RESOURCE, "textBook", 1 +// } + //, +// new Object[]{ +// ContentV3Scenario.TEST_GET_HIERARCHY_AFTER_FLAG_REJECT, "collectionInFlagged", CollectionUtilPayload.UPDATE_HIERARCHY_1_UNIT_1_RESOURCE, "textBook", 1 +// }, +// new Object[]{ +// ContentV3Scenario.TEST_GET_HIERARCHY_AFTER_DISCARD, "collectionDiscarded", CollectionUtilPayload.UPDATE_HIERARCHY_1_UNIT_1_RESOURCE, "textBook", 1 +// }, +// new Object[]{ +// ContentV3Scenario.TEST_GET_HIERARCHY_AFTER_UPDATE_LIVE, "collectionUnitsInLiveUpdate", CollectionUtilPayload.UPDATE_HIERARCHY_1_UNIT_1_RESOURCE, "textBook", 1 +// }, + + }; + } + + @DataProvider + public static Object[][] getHierarchyImageNodes() { + return new Object[][]{ +// new Object[]{ +// ContentV3Scenario.TEST_GET_HIERARCHY_AFTER_UPDATE, "collectionUnitsInDraft", CollectionUtilPayload.UPDATE_HIERARCHY_1_UNIT_1_RESOURCE, "textBook", 1 +// }, + new Object[]{ + ContentV3Scenario.TEST_GET_HIERARCHY_BEFORE_UPDATE, "collectionCreate", null, "textBook", 1 + }, + }; + } +} diff --git a/kp_service_test/src/test/java/org/sunbird/kp/test/util/CollectionUtil.java b/kp_service_test/src/test/java/org/sunbird/kp/test/util/CollectionUtil.java index f5fd201e..a0b0a671 100644 --- a/kp_service_test/src/test/java/org/sunbird/kp/test/util/CollectionUtil.java +++ b/kp_service_test/src/test/java/org/sunbird/kp/test/util/CollectionUtil.java @@ -48,20 +48,23 @@ public class CollectionUtil { */ public static Map prepareTestCollection(String workFlow, BaseCitrusTestRunner runner, Map payloadMap, String collectionType, Integer assetCount, Integer resourceCount, String mimeType) { - String updateHierarchyPayload = payloadMap.get("updateHierarchy"); + String updateHierarchyPayload = null; Map collectionMap = new HashMap<>(); - if (assetCount != 0) { - List assetIds = getLiveAsset(runner, assetCount, mimeType); - for (String assetId : assetIds) { - collectionMap.put("asset_" + (assetIds.indexOf(assetId) + 1), assetId); - updateHierarchyPayload = updateHierarchyPayload.replace("asset_" + (assetIds.indexOf(assetId) + 1), assetId); + if(!StringUtils.isEmpty(payloadMap.get("updateHierarchy"))) { + updateHierarchyPayload = payloadMap.get("updateHierarchy"); + if (assetCount != 0) { + List assetIds = getLiveAsset(runner, assetCount, mimeType); + for (String assetId : assetIds) { + collectionMap.put("asset_" + (assetIds.indexOf(assetId) + 1), assetId); + updateHierarchyPayload = updateHierarchyPayload.replace("asset_" + (assetIds.indexOf(assetId) + 1), assetId); + } } - } - if (resourceCount != 0) { - List resourceIds = getLiveResources(runner, resourceCount, mimeType, payloadMap.get("createResource")); - for (String resourceId : resourceIds) { - collectionMap.put("resource_" + (resourceIds.indexOf(resourceId) + 1), resourceId); - updateHierarchyPayload = updateHierarchyPayload.replace("resource_" + (resourceIds.indexOf(resourceId) + 1), resourceId); + if (resourceCount != 0) { + List resourceIds = getLiveResources(runner, resourceCount, mimeType, payloadMap.get("createResource")); + for (String resourceId : resourceIds) { + collectionMap.put("resource_" + (resourceIds.indexOf(resourceId) + 1), resourceId); + updateHierarchyPayload = updateHierarchyPayload.replace("resource_" + (resourceIds.indexOf(resourceId) + 1), resourceId); + } } } collectionMap.putAll(ContentUtil.createCollectionContent(runner, null, collectionType, null)); @@ -120,5 +123,4 @@ public static List getLiveAsset(BaseCitrusTestRunner runner, Integer ass }); return assetIds; } - } diff --git a/kp_service_test/src/test/java/org/sunbird/kp/test/util/ContentUtil.java b/kp_service_test/src/test/java/org/sunbird/kp/test/util/ContentUtil.java index a8305454..305e21f6 100644 --- a/kp_service_test/src/test/java/org/sunbird/kp/test/util/ContentUtil.java +++ b/kp_service_test/src/test/java/org/sunbird/kp/test/util/ContentUtil.java @@ -1076,6 +1076,8 @@ public static Map>> getCollectionWorkFlowMa put("AcceptFlag", () -> ContentUtil.acceptFlagContent(runner, null, null, contentId, headers)); put("RejectFlag", () -> ContentUtil.rejectFlagContent(runner, null, contentId, headers)); put("Get", () -> ContentUtil.readCollectionHierarchy(runner, contentId)); + put("Create", () -> ContentUtil.readCollectionHierarchy(runner, contentId)); + put("Review", () -> ContentUtil.reviewContent(runner, payload, testName, contentId, headers)); } }; } diff --git a/kp_service_test/src/test/java/org/sunbird/kp/test/util/TestSetupUtil.java b/kp_service_test/src/test/java/org/sunbird/kp/test/util/TestSetupUtil.java index 50abb5eb..6489a7fe 100644 --- a/kp_service_test/src/test/java/org/sunbird/kp/test/util/TestSetupUtil.java +++ b/kp_service_test/src/test/java/org/sunbird/kp/test/util/TestSetupUtil.java @@ -29,16 +29,16 @@ public static void createDirectoriesForTestCases(Map dirIdMap, S File file = new File(mainDir +"/"+ dir); file.mkdir(); if (file.isDirectory()) { - File responseFile = new File(file.getPath() + "/" + "response.json"); - File requestFile = new File(file.getPath() + "/" + "request.json"); - File validateFile = new File(file.getPath() + "/" + "validate.json"); +// File responseFile = new File(file.getPath() + "/" + "response.json"); +// File requestFile = new File(file.getPath() + "/" + "request.json"); +// File validateFile = new File(file.getPath() + "/" + "validate.json"); try { - if (!responseFile.exists()) - responseFile.createNewFile(); - if (!requestFile.exists()) - requestFile.createNewFile(); - if (!validateFile.exists()) - validateFile.createNewFile(); +// if (!responseFile.exists()) +// responseFile.createNewFile(); +// if (!requestFile.exists()) +// requestFile.createNewFile(); +// if (!validateFile.exists()) +// validateFile.createNewFile(); populateDataIntoValidateFiles(mainDir, dir, validationFileName, dirIdMap.get(dir)); } catch (Exception e) { e.printStackTrace(); @@ -53,7 +53,13 @@ private static void populateDataIntoValidateFiles(String mainDir, String directo if (file.isDirectory()) { try { FileWriter fileWriter = new FileWriter(file.getPath() + "/" + fileName); - HttpResponse jsonNode = Unirest.get(AppConfig.config.getString("kp_base_uri") + "/content/v3/read/" + contentId + "").asString(); +// HttpResponse jsonNode = Unirest.get(AppConfig.config.getString("kp_base_uri") + "/content/v3/read/" + contentId + "").asString(); + +// HttpResponse jsonNode = Unirest.get(AppConfig.config.getString("kp_base_uri") + "/content/v3/hierarchy/" + contentId).asString(); + + HttpResponse jsonNode = Unirest.get(AppConfig.config.getString("kp_base_uri") + "/content/v3/hierarchy/" + contentId + "?mode=edit").asString(); + + //kp_content_service_base_uri Response response = objectMapper.readValue(jsonNode.getBody(), Response.class); fileWriter.write(formGeneralAssertions(response)); fileWriter.close(); @@ -78,6 +84,20 @@ private static String formGeneralAssertions(Response response) { .replaceAll("\"s3Key\"\\W?:\\W\"[a-zA-Z:/._0-9-]+\"","\"s3Key\" : \"@ignore@\"") .replaceAll("\"appId\"\\W?:\\W?\"[a-zA-Z.-]+\"","\"appId\" : \"@ignore@\"") .replaceAll("\"consumerId\"\\W?:\\W?\"[a-zA-Z0-9-]+\"","\"consumerId\" : \"@ignore@\"") + .replaceAll("\"versionKey\"\\W?:\\W\"\\d+\"","\"versionKey\" : \"@ignore@\"") + .replaceAll("\"pkgVersion\"\\W?:\\W\\d+\\.\\d+","\"pkgVersion\" : \"@isNumber()@\"") + .replaceAll("\"parent\"\\W?:\\W\"[a-zA-Z://._0-9-]+\"","\"parent\" : \"@ignore@\"") + .replaceAll("\"size\"\\W?:\\W\\d+\\.\\d+","\"size\" : \"@isNumber()@\"") + .replaceAll("\"totalCompressedSize\"\\W?:\\W\\d+\\.\\d+","\"totalCompressedSize\" : \"@isNumber()@\"") + .replaceAll("\"childNodes\"\\W?:\\W\\[[^\\[]*\\]+","\"childNodes\" : \"@ignore@\"") + .replaceAll("\"toc_url\"\\W?:\\W\"[a-zA-Z://._0-9-]+\"","\"toc_url\" : \"@ignore@\"") + .replaceAll("\"leafNodes\"\\W?:\\W\\[[^\\[]*\\]+","\"leafNodes\" : \"@ignore@\"") + .replaceAll("\"version\"\\W?:\\W\\d+","\"version\" : \"@isNumber()@\"") + .replaceAll("\"compatibilityLevel\"\\W?:\\W\\d+","\"compatibilityLevel\" : \"@isNumber()@\"") + .replaceAll("\"leafNodesCount\"\\W?:\\W\\d+","\"leafNodesCount\" : \"@isNumber()@\"") + .replaceAll("\"mimeTypesCount\"\\W?:\\W\\{([^}]+)\\}+","\"mimeTypesCount\" : \"@ignore@\"") + .replaceAll("\"contentTypesCount\"\\W?:\\W\\{([^}]+)\\}+","\"contentTypesCount\" : \"@ignore@\"") + .replaceAll("\"errmsg\"\\W?:\\W\\[a-zA-Z0-9-]+","\"errmsg\" : \"@ignore@\""); .replaceAll("kp_ft_\\d+","\\${identifier}") .replaceAll("KP_FT_\\d+","\\${identifier}") .replaceAll("kp_ft_license_\\d+", "\\${identifier}") diff --git a/kp_service_test/src/test/java/org/sunbird/kp/test/util/WorkflowConstants.java b/kp_service_test/src/test/java/org/sunbird/kp/test/util/WorkflowConstants.java index 3dfbf22e..f6004703 100644 --- a/kp_service_test/src/test/java/org/sunbird/kp/test/util/WorkflowConstants.java +++ b/kp_service_test/src/test/java/org/sunbird/kp/test/util/WorkflowConstants.java @@ -37,8 +37,15 @@ public class WorkflowConstants { "\"collectionUnitsInDraft\":[\"Update\"],\n" + "\"collectionUnitsInLive\":[\"Update\", \"Publish\"],\n" + "\"collectionRead\":[\"Update\", \"Publish\"],\n" + - "\"collectionUnitsResourcesInDraft\":[\"CreateResources\", \"Update\"]\n" + + "\"collectionUnitsResourcesInDraft\":[\"CreateResources\", \"Update\"],\n" + + "\"collectionCreate\":[\"Create\"],\n"+ + "\"collectionReview\":[\"Update\", \"Review\"],\n"+ + "\"collectionRetire\":[\"Retire\"],\n"+ + "\"collectionInFlagged\":[\"Update\", \"Publish\", \"Get\", \"Flag\"],\n"+ + "\"contentInFlagDraft\" : [\"Update\", \"Publish\", \"Get\", \"Flag\", \"AcceptFlag\"],\n" + + "\"contentInFlagReject\" : [\"Update\", \"Publish\", \"Get\", \"Flag\", \"RejectFlag\"],\n" + + "\"collectionDiscarded\":[\"Discard\"],\n"+ + "\"collectionUnitsInLiveUpdate\":[\"Update\", \"Publish\", \"Update\"]\n" + "}"; - } diff --git a/kp_service_test/src/test/resources/templates/content/v3/hierarchy/get/testGetHierarchyAfterFlag/response.json b/kp_service_test/src/test/resources/templates/content/v3/hierarchy/get/testGetHierarchyAfterFlag/response.json new file mode 100644 index 00000000..c3838deb --- /dev/null +++ b/kp_service_test/src/test/resources/templates/content/v3/hierarchy/get/testGetHierarchyAfterFlag/response.json @@ -0,0 +1,153 @@ +{ + "id" : "api.content.hierarchy.get", + "ver" : "3.0", + "ts" : "@matchesDatePattern('yyyy-MM-dd')@", + "params" : { + "resmsgid" : "@ignore@", + "msgid" : null, + "err" : null, + "status" : "successful", + "errmsg" : null + }, + "responseCode" : "OK", + "result" : { + "content" : { + "lastStatusChangedOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "children" : [ { + "parent" : "@ignore@", + "identifier" : "@ignore@", + "lastStatusChangedOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "code" : "@ignore@", + "visibility" : "Parent", + "description" : "@ignore@", + "index" : 1, + "mimeType" : "application/vnd.ekstep.content-collection", + "createdOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "versionKey" : "@ignore@", + "depth" : 1, + "children" : [ { + "ownershipType" : [ "createdBy" ], + "previewUrl" : "@ignore@", + "code" : "kp.ft.resource.ecml", + "downloadUrl" : "@ignore@", + "channel" : "channel-01", + "description" : "KP Integration Test Content", + "language" : [ "English" ], + "variants" : { + "spine" : { + "ecarUrl" : "@ignore@", + "size" : "@isNumber()@" + } + }, + "streamingUrl" :"@ignore@", + "mimeType" : "application/vnd.ekstep.ecml-archive", + "idealScreenSize" : "normal", + "publishComment" : "OK", + "createdOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "contentDisposition" : "inline", + "artifactUrl" : "@ignore@", + "contentEncoding" : "gzip", + "lastUpdatedOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "SYS_INTERNAL_LAST_UPDATED_ON" : "@matchesDatePattern('yyyy-MM-dd')@", + "contentType" : "Resource", + "dialcodeRequired" : "No", + "lastUpdatedBy" : "KP_FT_PUBLISHER", + "identifier" : "@ignore@", + "audience" : [ "Learner" ], + "lastStatusChangedOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "os" : [ "All" ], + "visibility" : "Default", + "consumerId" : "@ignore@", + "mediaType" : "content", + "osId" : "org.ekstep.quiz.app", + "lastPublishedBy" : "KP_FT_PUBLISHER", + "version" : "@isNumber()@", + "pkgVersion" : "@isNumber()@", + "versionKey" : "@ignore@", + "license" : "CC BY 4.0", + "idealScreenDensity" : "hdpi", + "s3Key" : "@ignore@", + "framework" : "NCF", + "lastPublishedOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "size" : "@isNumber()@", + "compatibilityLevel" : "@isNumber()@", + "name" : "KP Integration Test Content", + "publisher" : "KP_FT_PUBLISHER", + "status" : "Live", + "index" : 1, + "depth" : 2, + "parent" : "@ignore@" + } ], + "name" : "@ignore@", + "lastUpdatedOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "contentType" : "TextBook", + "status" : "Live", + "compatibilityLevel" : "@isNumber()@", + "lastPublishedOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "pkgVersion" : "@isNumber()@", + "leafNodesCount" : "@isNumber()@", + "downloadUrl" : "@ignore@", + "variants" : "@ignore@" + } ], + "mediaType" : "content", + "name" : "KP Integration Test Collection Content", + "toc_url" : "@ignore@", + "createdOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "channel" : "channel-01", + "lastUpdatedOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "size" : "@isNumber()@", + "identifier" : "${rootId}", + "description" : "KP Integration Test Collection Content", + "ownershipType" : [ "createdBy" ], + "compatibilityLevel" : "@isNumber()@", + "audience" : [ "Learner" ], + "os" : [ "All" ], + "collections" : [ ], + "SYS_INTERNAL_LAST_UPDATED_ON" : "@matchesDatePattern('yyyy-MM-dd')@", + "downloadUrl" : "@ignore@", + "usedByContent" : [ ], + "framework" : "NCF", + "totalCompressedSize" : "@isNumber()@", + "versionKey" : "@ignore@", + "mimeType" : "application/vnd.ekstep.content-collection", + "code" : "kp.ft.collection.textbook", + "license" : "CC BY 4.0", + "leafNodes" : "@ignore@", + "version" : "@isNumber()@", + "contentType" : "TextBook", + "language" : [ "English" ], + "lastPublishedOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "contentTypesCount" : "{\"Resource\":1,\"TextBook\":1}", + "objectType" : "Content", + "lastUpdatedBy" : "KP_FT_PUBLISHER", + "status" : "Live", + "publisher" : "KP_FT_PUBLISHER", + "publishComment" : "OK", + "dialcodeRequired" : "No", + "idealScreenSize" : "normal", + "contentEncoding" : "gzip", + "leafNodesCount" : "@isNumber()@", + "depth" : 0, + "consumerId" : "@ignore@", + "lastPublishedBy" : "KP_FT_PUBLISHER", + "mimeTypesCount" : "{\"application/vnd.ekstep.content-collection\":1,\"application/vnd.ekstep.ecml-archive\":1}", + "osId" : "org.ekstep.quiz.app", + "s3Key" : "@ignore@", + "contentDisposition" : "inline", + "childNodes" : "@ignore@", + "visibility" : "Default", + "variants" : { + "online" : { + "ecarUrl" : "@ignore@", + "size" : "@isNumber()@" + }, + "spine" : { + "ecarUrl" : "@ignore@", + "size" : "@isNumber()@" + } + }, + "pkgVersion" : "@isNumber()@", + "idealScreenDensity" : "hdpi" + } + } +} \ No newline at end of file diff --git a/kp_service_test/src/test/resources/templates/content/v3/hierarchy/get/testGetHierarchyAfterFlag/response_image.json b/kp_service_test/src/test/resources/templates/content/v3/hierarchy/get/testGetHierarchyAfterFlag/response_image.json new file mode 100644 index 00000000..aa1cfa39 --- /dev/null +++ b/kp_service_test/src/test/resources/templates/content/v3/hierarchy/get/testGetHierarchyAfterFlag/response_image.json @@ -0,0 +1,148 @@ +{ + "id" : "api.content.hierarchy.get", + "ver" : "3.0", + "ts" : "@matchesDatePattern('yyyy-MM-dd')@", + "params" : { + "resmsgid" : "@ignore@", + "msgid" : null, + "err" : null, + "status" : "successful", + "errmsg" : null + }, + "responseCode" : "OK", + "result" : { + "content" : { + "ownershipType" : [ "createdBy" ], + "channel" : "channel-01", + "downloadUrl" : "@ignore@", + "language" : [ "English" ], + "variants" : { + "online" : { + "ecarUrl" : "@ignore@", + "size" : "@isNumber()@" + }, + "spine" : { + "ecarUrl" : "@ignore@", + "size" : "@isNumber()@" + } + }, + "mimeType" : "application/vnd.ekstep.content-collection", + "leafNodes" : "@ignore@", + "children" : [ { + "parent" : "@ignore@", + "identifier" : "@ignore@", + "lastStatusChangedOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "code" : "2cb4d698-dc19-4f0c-9990-96f49daff753", + "visibility" : "Parent", + "description" : "@ignore@", + "index" : 1, + "mimeType" : "application/vnd.ekstep.content-collection", + "createdOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "versionKey" : "@ignore@", + "depth" : 1, + "children" : [ { + "ownershipType" : [ "createdBy" ], + "parent" : "@ignore@", + "previewUrl" : "@ignore@", + "code" : "kp.ft.resource.ecml", + "downloadUrl" : "@ignore@", + "channel" : "channel-01", + "description" : "KP Integration Test Content", + "language" : [ "English" ], + "variants" : { + "spine" : { + "ecarUrl" : "@ignore@", + "size" : "@isNumber()@" + } + }, + "streamingUrl" :"@ignore@", + "mimeType" : "application/vnd.ekstep.ecml-archive", + "idealScreenSize" : "normal", + "publishComment" : "OK", + "createdOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "contentDisposition" : "inline", + "artifactUrl" : "@ignore@", + "contentEncoding" : "gzip", + "lastUpdatedOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "SYS_INTERNAL_LAST_UPDATED_ON" : "@matchesDatePattern('yyyy-MM-dd')@", + "contentType" : "Resource", + "dialcodeRequired" : "No", + "lastUpdatedBy" : "KP_FT_PUBLISHER", + "identifier" : "@ignore@", + "audience" : [ "Learner" ], + "lastStatusChangedOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "os" : [ "All" ], + "visibility" : "Default", + "consumerId" : "@ignore@", + "index" : 1, + "mediaType" : "content", + "osId" : "org.ekstep.quiz.app", + "lastPublishedBy" : "KP_FT_PUBLISHER", + "version" : "@isNumber()@", + "pkgVersion" : "@isNumber()@", + "versionKey" : "@ignore@", + "license" : "CC BY 4.0", + "idealScreenDensity" : "hdpi", + "s3Key" : "@ignore@", + "framework" : "NCF", + "depth" : 2, + "lastPublishedOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "size" : "@isNumber()@", + "compatibilityLevel" : "@isNumber()@", + "name" : "KP Integration Test Content", + "publisher" : "KP_FT_PUBLISHER", + "status" : "Live" + } ], + "name" : "@ignore@", + "lastUpdatedOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "contentType" : "TextBook", + "status" : "Draft" + } ], + "contentEncoding" : "gzip", + "mimeTypesCount" : "{\"application/vnd.ekstep.content-collection\":1,\"application/vnd.ekstep.ecml-archive\":1}", + "totalCompressedSize" : "@isNumber()@", + "contentType" : "TextBook", + "lastUpdatedBy" : "KP-Tester", + "identifier" : "${rootId}", + "audience" : [ "Learner" ], + "toc_url" : "@ignore@", + "visibility" : "Default", + "contentTypesCount" : "{\"Resource\":1,\"TextBook\":1}", + "childNodes" : "@ignore@", + "consumerId" : "@ignore@", + "mediaType" : "content", + "osId" : "org.ekstep.quiz.app", + "lastPublishedBy" : "KP_FT_PUBLISHER", + "version" : "@isNumber()@", + "license" : "CC BY 4.0", + "lastPublishedOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "size" : "@isNumber()@", + "name" : "KP Integration Test Collection Content", + "publisher" : "KP_FT_PUBLISHER", + "status" : "Flagged", + "code" : "kp.ft.collection.textbook", + "flags" : [ "kp-flags", "newKp-flags" ], + "description" : "KP Integration Test Collection Content", + "lastFlaggedOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "flaggedBy" : [ "KP-Tester" ], + "publishComment" : "OK", + "idealScreenSize" : "normal", + "createdOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "contentDisposition" : "inline", + "lastUpdatedOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "SYS_INTERNAL_LAST_UPDATED_ON" : "@matchesDatePattern('yyyy-MM-dd')@", + "dialcodeRequired" : "No", + "lastStatusChangedOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "flagReasons" : [ "Copyright Violation" ], + "os" : [ "All" ], + "pkgVersion" : "@isNumber()@", + "versionKey" : "@ignore@", + "idealScreenDensity" : "hdpi", + "s3Key" : "@ignore@", + "depth" : 0, + "framework" : "NCF", + "leafNodesCount" : "@isNumber()@", + "compatibilityLevel" : "@isNumber()@" + } + } +} \ No newline at end of file diff --git a/kp_service_test/src/test/resources/templates/content/v3/hierarchy/get/testGetHierarchyAfterRetire/response.json b/kp_service_test/src/test/resources/templates/content/v3/hierarchy/get/testGetHierarchyAfterRetire/response.json new file mode 100644 index 00000000..36e9505f --- /dev/null +++ b/kp_service_test/src/test/resources/templates/content/v3/hierarchy/get/testGetHierarchyAfterRetire/response.json @@ -0,0 +1,14 @@ +{ + "id": "api.content.hierarchy.get", + "ver": "3.0", + "ts": "@matchesDatePattern('yyyy-MM-dd')@", + "params": { + "resmsgid": "@ignore@", + "msgid": null, + "err": "RESOURCE_NOT_FOUND", + "status": "failed", + "errmsg": "@ignore@" + }, + "responseCode": "RESOURCE_NOT_FOUND", + "result": {} +} \ No newline at end of file diff --git a/kp_service_test/src/test/resources/templates/content/v3/hierarchy/get/testGetHierarchyAfterReview/response.json b/kp_service_test/src/test/resources/templates/content/v3/hierarchy/get/testGetHierarchyAfterReview/response.json new file mode 100644 index 00000000..aaae515b --- /dev/null +++ b/kp_service_test/src/test/resources/templates/content/v3/hierarchy/get/testGetHierarchyAfterReview/response.json @@ -0,0 +1,14 @@ +{ + "id" : "api.content.hierarchy.get", + "ver" : "3.0", + "ts" : "@matchesDatePattern('yyyy-MM-dd')@", + "params" : { + "resmsgid" : "@ignore@", + "msgid" : null, + "err" : "RESOURCE_NOT_FOUND", + "status" : "failed", + "errmsg" : "@ignore@" + }, + "responseCode" : "RESOURCE_NOT_FOUND", + "result" : { } +} \ No newline at end of file diff --git a/kp_service_test/src/test/resources/templates/content/v3/hierarchy/get/testGetHierarchyAfterReview/response_image.json b/kp_service_test/src/test/resources/templates/content/v3/hierarchy/get/testGetHierarchyAfterReview/response_image.json new file mode 100644 index 00000000..b035ff77 --- /dev/null +++ b/kp_service_test/src/test/resources/templates/content/v3/hierarchy/get/testGetHierarchyAfterReview/response_image.json @@ -0,0 +1,118 @@ +{ + "id" : "api.content.hierarchy.get", + "ver" : "3.0", + "ts" : "@matchesDatePattern('yyyy-MM-dd')@", + "params" : { + "resmsgid" : "@ignore@", + "msgid" : null, + "err" : null, + "status" : "successful", + "errmsg" : null + }, + "responseCode" : "OK", + "result" : { + "content" : { + "ownershipType" : [ "createdBy" ], + "code" : "kp.ft.collection.textbook", + "channel" : "channel-01", + "description" : "KP Integration Test Collection Content", + "language" : [ "English" ], + "mimeType" : "application/vnd.ekstep.content-collection", + "idealScreenSize" : "normal", + "createdOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "children" : [ { + "parent" : "@ignore@", + "identifier" : "@ignore@", + "lastStatusChangedOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "code" : "@ignore@", + "visibility" : "Parent", + "description" : "@ignore@", + "index" : 1, + "mimeType" : "application/vnd.ekstep.content-collection", + "createdOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "versionKey" : "@ignore@", + "depth" : 1, + "children" : [ { + "ownershipType" : [ "createdBy" ], + "parent" : "@ignore@", + "previewUrl" : "@ignore@", + "code" : "kp.ft.resource.ecml", + "downloadUrl" : "@ignore@", + "channel" : "channel-01", + "description" : "KP Integration Test Content", + "language" : [ "English" ], + "variants" : { + "spine" : { + "ecarUrl" : "@ignore@", + "size" : "@isNumber()@" + } + }, + "streamingUrl" :"@ignore@", + "mimeType" : "application/vnd.ekstep.ecml-archive", + "idealScreenSize" : "normal", + "publishComment" : "OK", + "createdOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "contentDisposition" : "inline", + "artifactUrl" : "@ignore@", + "contentEncoding" : "gzip", + "lastUpdatedOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "SYS_INTERNAL_LAST_UPDATED_ON" : "@matchesDatePattern('yyyy-MM-dd')@", + "dialcodeRequired" : "No", + "contentType" : "Resource", + "lastUpdatedBy" : "KP_FT_PUBLISHER", + "identifier" : "@ignore@", + "audience" : [ "Learner" ], + "lastStatusChangedOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "os" : [ "All" ], + "visibility" : "Default", + "consumerId" : "@ignore@", + "index" : 1, + "mediaType" : "content", + "osId" : "org.ekstep.quiz.app", + "lastPublishedBy" : "KP_FT_PUBLISHER", + "version" : "@isNumber()@", + "pkgVersion" : "@isNumber()@", + "versionKey" : "@ignore@", + "license" : "CC BY 4.0", + "idealScreenDensity" : "hdpi", + "s3Key" : "@ignore@", + "framework" : "NCF", + "depth" : 2, + "size" : "@isNumber()@", + "lastPublishedOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "compatibilityLevel" : "@isNumber()@", + "name" : "KP Integration Test Content", + "publisher" : "KP_FT_PUBLISHER", + "status" : "Live" + } ], + "name" : "@ignore@", + "lastUpdatedOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "contentType" : "TextBook", + "status" : "Draft" + } ], + "contentDisposition" : "inline", + "contentEncoding" : "gzip", + "lastUpdatedOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "dialcodeRequired" : "No", + "contentType" : "TextBook", + "audience" : [ "Learner" ], + "lastStatusChangedOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "os" : [ "All" ], + "visibility" : "Default", + "childNodes" : "@ignore@", + "consumerId" : "@ignore@", + "mediaType" : "content", + "osId" : "org.ekstep.quiz.app", + "version" : "@isNumber()@", + "versionKey" : "@ignore@", + "license" : "CC BY 4.0", + "idealScreenDensity" : "hdpi", + "depth" : 0, + "framework" : "NCF", + "lastSubmittedOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "compatibilityLevel" : "@isNumber()@", + "name" : "KP Integration Test Collection Content", + "status" : "Review" + } + } +} \ No newline at end of file diff --git a/kp_service_test/src/test/resources/templates/content/v3/hierarchy/get/testGetHierarchyAfterUpdate/response.json b/kp_service_test/src/test/resources/templates/content/v3/hierarchy/get/testGetHierarchyAfterUpdate/response.json new file mode 100644 index 00000000..aaae515b --- /dev/null +++ b/kp_service_test/src/test/resources/templates/content/v3/hierarchy/get/testGetHierarchyAfterUpdate/response.json @@ -0,0 +1,14 @@ +{ + "id" : "api.content.hierarchy.get", + "ver" : "3.0", + "ts" : "@matchesDatePattern('yyyy-MM-dd')@", + "params" : { + "resmsgid" : "@ignore@", + "msgid" : null, + "err" : "RESOURCE_NOT_FOUND", + "status" : "failed", + "errmsg" : "@ignore@" + }, + "responseCode" : "RESOURCE_NOT_FOUND", + "result" : { } +} \ No newline at end of file diff --git a/kp_service_test/src/test/resources/templates/content/v3/hierarchy/get/testGetHierarchyAfterUpdate/response_image.json b/kp_service_test/src/test/resources/templates/content/v3/hierarchy/get/testGetHierarchyAfterUpdate/response_image.json new file mode 100644 index 00000000..3d4b55f8 --- /dev/null +++ b/kp_service_test/src/test/resources/templates/content/v3/hierarchy/get/testGetHierarchyAfterUpdate/response_image.json @@ -0,0 +1,118 @@ +{ + "id" : "api.content.hierarchy.get", + "ver" : "3.0", + "ts" : "@matchesDatePattern('yyyy-MM-dd')@", + "params" : { + "resmsgid" : "@ignore@", + "msgid" : null, + "err" : null, + "status" : "successful", + "errmsg" : null + }, + "responseCode" : "OK", + "result" : { + "content" : { + "ownershipType" : [ "createdBy" ], + "code" : "kp.ft.collection.textbook", + "channel" : "channel-01", + "description" : "KP Integration Test Collection Content", + "language" : [ "English" ], + "mimeType" : "application/vnd.ekstep.content-collection", + "idealScreenSize" : "normal", + "createdOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "children" : [ { + "parent" : "@ignore@", + "identifier" : "@ignore@", + "lastStatusChangedOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "code" : "@ignore@", + "visibility" : "Parent", + "description" : "@ignore@", + "index" : 1, + "mimeType" : "application/vnd.ekstep.content-collection", + "createdOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "versionKey" : "@ignore@", + "depth" : 1, + "children" : [ { + "ownershipType" : [ "createdBy" ], + "parent" : "@ignore@", + "previewUrl" : "@ignore@", + "code" : "kp.ft.resource.ecml", + "downloadUrl" : "@ignore@", + "channel" : "channel-01", + "description" : "KP Integration Test Content", + "language" : [ "English" ], + "variants" : { + "spine" : { + "ecarUrl" : "@ignore@", + "size" : "@isNumber()@" + } + }, + "streamingUrl" :"@ignore@", + "mimeType" : "application/vnd.ekstep.ecml-archive", + "idealScreenSize" : "normal", + "publishComment" : "OK", + "createdOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "contentDisposition" : "inline", + "artifactUrl" : "@ignore@", + "contentEncoding" : "gzip", + "lastUpdatedOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "SYS_INTERNAL_LAST_UPDATED_ON" : "@matchesDatePattern('yyyy-MM-dd')@", + "contentType" : "Resource", + "dialcodeRequired" : "No", + "lastUpdatedBy" : "KP_FT_PUBLISHER", + "identifier" : "@ignore@", + "audience" : [ "Learner" ], + "lastStatusChangedOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "os" : [ "All" ], + "visibility" : "Default", + "consumerId" : "@ignore@", + "index" : 1, + "mediaType" : "content", + "osId" : "org.ekstep.quiz.app", + "lastPublishedBy" : "KP_FT_PUBLISHER", + "version" : "@isNumber()@", + "pkgVersion" : "@isNumber()@", + "versionKey" : "@ignore@", + "license" : "CC BY 4.0", + "idealScreenDensity" : "hdpi", + "s3Key" : "@ignore@", + "framework" : "NCF", + "depth" : 2, + "lastPublishedOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "size" : "@isNumber()@", + "compatibilityLevel" : "@isNumber()@", + "name" : "KP Integration Test Content", + "publisher" : "KP_FT_PUBLISHER", + "status" : "Live" + } ], + "name" : "@ignore@", + "lastUpdatedOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "contentType" : "TextBook", + "status" : "Draft" + } ], + "contentDisposition" : "inline", + "contentEncoding" : "gzip", + "lastUpdatedOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "contentType" : "TextBook", + "dialcodeRequired" : "No", + "identifier" : "${rootId}", + "audience" : [ "Learner" ], + "lastStatusChangedOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "os" : [ "All" ], + "visibility" : "Default", + "childNodes" : "@ignore@", + "consumerId" : "@ignore@", + "mediaType" : "content", + "osId" : "org.ekstep.quiz.app", + "version" : "@isNumber()@", + "versionKey" : "@ignore@", + "license" : "CC BY 4.0", + "idealScreenDensity" : "hdpi", + "depth" : 0, + "framework" : "NCF", + "compatibilityLevel" : "@isNumber()@", + "name" : "KP Integration Test Collection Content", + "status" : "Draft" + } + } +} \ No newline at end of file diff --git a/kp_service_test/src/test/resources/templates/content/v3/hierarchy/get/testGetHierarchyBeforeUpdate/response.json b/kp_service_test/src/test/resources/templates/content/v3/hierarchy/get/testGetHierarchyBeforeUpdate/response.json new file mode 100644 index 00000000..aaae515b --- /dev/null +++ b/kp_service_test/src/test/resources/templates/content/v3/hierarchy/get/testGetHierarchyBeforeUpdate/response.json @@ -0,0 +1,14 @@ +{ + "id" : "api.content.hierarchy.get", + "ver" : "3.0", + "ts" : "@matchesDatePattern('yyyy-MM-dd')@", + "params" : { + "resmsgid" : "@ignore@", + "msgid" : null, + "err" : "RESOURCE_NOT_FOUND", + "status" : "failed", + "errmsg" : "@ignore@" + }, + "responseCode" : "RESOURCE_NOT_FOUND", + "result" : { } +} \ No newline at end of file diff --git a/kp_service_test/src/test/resources/templates/content/v3/hierarchy/get/testGetHierarchyBeforeUpdate/response_image.json b/kp_service_test/src/test/resources/templates/content/v3/hierarchy/get/testGetHierarchyBeforeUpdate/response_image.json new file mode 100644 index 00000000..69772537 --- /dev/null +++ b/kp_service_test/src/test/resources/templates/content/v3/hierarchy/get/testGetHierarchyBeforeUpdate/response_image.json @@ -0,0 +1,50 @@ +{ + "id" : "ekstep.learning.content.hierarchy", + "ver" : "3.0", + "ts" : "@matchesDatePattern('yyyy-MM-dd')@", + "params" : { + "resmsgid" : "@ignore@", + "msgid" : null, + "err" : null, + "status" : "successful", + "errmsg" : null + }, + "responseCode" : "OK", + "result" : { + "content" : { + "ownershipType" : [ "createdBy" ], + "parent" : "@ignore@", + "code" : "kp.ft.collection.textbook", + "channel" : "channel-01", + "description" : "KP Integration Test Collection Content", + "language" : [ "English" ], + "mimeType" : "application/vnd.ekstep.content-collection", + "idealScreenSize" : "normal", + "createdOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "objectType" : "Content", + "contentDisposition" : "inline", + "lastUpdatedOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "contentEncoding" : "gzip", + "contentType" : "TextBook", + "dialcodeRequired" : "No", + "identifier" : "KP_FT_1578373926608", + "audience" : [ "Learner" ], + "lastStatusChangedOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "visibility" : "Default", + "os" : [ "All" ], + "consumerId" : "@ignore@", + "index" : null, + "mediaType" : "content", + "osId" : "org.ekstep.quiz.app", + "version" : "@isNumber()@", + "versionKey" : "@ignore@", + "license" : "CC BY 4.0", + "idealScreenDensity" : "hdpi", + "depth" : 0, + "framework" : "NCF", + "compatibilityLevel" : "@isNumber()@", + "name" : "KP Integration Test Collection Content", + "status" : "Draft" + } + } +} \ No newline at end of file diff --git a/kp_service_test/src/test/resources/templates/content/v3/hierarchy/get/testGetHierarchyWithEditMode/response.json b/kp_service_test/src/test/resources/templates/content/v3/hierarchy/get/testGetHierarchyWithEditMode/response.json new file mode 100644 index 00000000..24a74185 --- /dev/null +++ b/kp_service_test/src/test/resources/templates/content/v3/hierarchy/get/testGetHierarchyWithEditMode/response.json @@ -0,0 +1,99 @@ +{ + "id" : "api.content.hierarchy.get", + "ver" : "3.0", + "ts" : "@matchesDatePattern('yyyy-MM-dd')@", + "params" : { + "resmsgid" : "@ignore@", + "msgid" : null, + "err" : null, + "status" : "successful", + "errmsg" : null + }, + "responseCode" : "OK", + "result" : { + "content" : { + "ownershipType" : [ "createdBy" ], + "code" : "kp.ft.collection.textbook", + "channel" : "channel-01", + "description" : "KP Integration Test Collection Content", + "language" : [ "English" ], + "mimeType" : "application/vnd.ekstep.content-collection", + "idealScreenSize" : "normal", + "createdOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "children" : [ { + "parent" : "@ignore@", + "identifier" : "@ignore@", + "lastStatusChangedOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "code" : "@ignore@", + "visibility" : "Parent", + "description" : "@ignore@", + "index" : 1, + "mimeType" : "application/vnd.ekstep.content-collection", + "createdOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "versionKey" : "@ignore@", + "depth" : 1, + "children" : [ { + "ownershipType" : [ "createdBy" ], + "parent" : "@ignore@", + "code" : "kp.ft.resource.ecml", + "channel" : "channel-01", + "description" : "KP Integration Test Content", + "language" : [ "English" ], + "mimeType" : "application/vnd.ekstep.ecml-archive", + "idealScreenSize" : "normal", + "createdOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "contentDisposition" : "inline", + "artifactUrl" : "@ignore@", + "contentEncoding" : "gzip", + "lastUpdatedOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "dialcodeRequired" : "No", + "contentType" : "Resource", + "identifier" : "@ignore@", + "audience" : [ "Learner" ], + "lastStatusChangedOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "os" : [ "All" ], + "visibility" : "Default", + "consumerId" : "@ignore@", + "index" : 1, + "mediaType" : "content", + "osId" : "org.ekstep.quiz.app", + "version" : "@isNumber()@", + "versionKey" : "@ignore@", + "license" : "CC BY 4.0", + "idealScreenDensity" : "hdpi", + "framework" : "NCF", + "depth" : 2, + "compatibilityLevel" : "@isNumber()@", + "name" : "KP Integration Test Content", + "status" : "Live" + } ], + "name" : "@ignore@", + "lastUpdatedOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "contentType" : "TextBook", + "status" : "Draft" + } ], + "contentDisposition" : "inline", + "contentEncoding" : "gzip", + "lastUpdatedOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "dialcodeRequired" : "No", + "contentType" : "TextBook", + "audience" : [ "Learner" ], + "lastStatusChangedOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "os" : [ "All" ], + "visibility" : "Default", + "childNodes" : "@ignore@", + "consumerId" : "@ignore@", + "mediaType" : "content", + "osId" : "org.ekstep.quiz.app", + "version" : "@isNumber()@", + "versionKey" : "@ignore@", + "license" : "CC BY 4.0", + "idealScreenDensity" : "hdpi", + "depth" : 0, + "framework" : "NCF", + "compatibilityLevel" : 1, + "name" : "KP Integration Test Collection Content", + "status" : "Draft" + } + } +} \ No newline at end of file diff --git a/kp_service_test/src/test/resources/templates/content/v3/hierarchy/get/testGetHierarchyWithEmptyMode/response.json b/kp_service_test/src/test/resources/templates/content/v3/hierarchy/get/testGetHierarchyWithEmptyMode/response.json new file mode 100644 index 00000000..4ccfbc03 --- /dev/null +++ b/kp_service_test/src/test/resources/templates/content/v3/hierarchy/get/testGetHierarchyWithEmptyMode/response.json @@ -0,0 +1,163 @@ +{ + "id" : "api.content.hierarchy.get", + "ver" : "3.0", + "ts" : "@matchesDatePattern('yyyy-MM-dd')@", + "params" : { + "resmsgid" : "@ignore@", + "msgid" : null, + "err" : null, + "status" : "successful", + "errmsg" : null + }, + "responseCode" : "OK", + "result" : { + "content" : { + "lastStatusChangedOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "children" : [ { + "parent" : "@ignore@", + "identifier" : "@ignore@", + "lastStatusChangedOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "code" : "@ignore@", + "visibility" : "Parent", + "description" : "@ignore@", + "index" : 1, + "mimeType" : "application/vnd.ekstep.content-collection", + "createdOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "versionKey" : "@ignore@", + "depth" : 1, + "children" : [ { + "ownershipType": [ + "createdBy" + ], + "previewUrl": "@ignore@", + "code": "kp.ft.resource.ecml", + "downloadUrl": "@ignore@", + "channel": "channel-01", + "description": "KP Integration Test Content", + "language": [ + "English" + ], + "variants": { + "spine": { + "ecarUrl": "@ignore@", + "size": "@isNumber()@" + } + }, + "streamingUrl": "@ignore@", + "mimeType": "application/vnd.ekstep.ecml-archive", + "idealScreenSize": "normal", + "publishComment": "OK", + "createdOn": "@matchesDatePattern('yyyy-MM-dd')@", + "contentDisposition": "inline", + "artifactUrl": "@ignore@", + "contentEncoding": "gzip", + "lastUpdatedOn": "@matchesDatePattern('yyyy-MM-dd')@", + "SYS_INTERNAL_LAST_UPDATED_ON": "@matchesDatePattern('yyyy-MM-dd')@", + "dialcodeRequired": "No", + "contentType": "Resource", + "lastUpdatedBy": "KP_FT_PUBLISHER", + "identifier": "@ignore@", + "audience": [ + "Learner" + ], + "lastStatusChangedOn": "@matchesDatePattern('yyyy-MM-dd')@", + "os": [ + "All" + ], + "visibility": "Default", + "consumerId": "@ignore@", + "mediaType": "content", + "osId": "org.ekstep.quiz.app", + "lastPublishedBy": "KP_FT_PUBLISHER", + "version": "@isNumber()@", + "pkgVersion": "@isNumber()@", + "versionKey": "@ignore@", + "license": "CC BY 4.0", + "idealScreenDensity": "hdpi", + "s3Key": "@ignore@", + "framework": "NCF", + "size": "@isNumber()@", + "lastPublishedOn": "@matchesDatePattern('yyyy-MM-dd')@", + "compatibilityLevel": "@isNumber()@", + "name": "KP Integration Test Content", + "publisher": "KP_FT_PUBLISHER", + "status": "Live", + "index": 1, + "depth": 2, + "parent": "@ignore@" + }], + "name" : "@ignore@", + "lastUpdatedOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "contentType" : "TextBook", + "status" : "Live", + "compatibilityLevel" : "@isNumber()@", + "lastPublishedOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "pkgVersion" : "@isNumber()@", + "leafNodesCount" : "@isNumber()@", + "downloadUrl" : "@ignore@", + "variants" : "@ignore@" + } ], + "mediaType" : "content", + "name" : "KP Integration Test Collection Content", + "toc_url" : "@ignore@", + "createdOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "channel" : "channel-01", + "lastUpdatedOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "size" : "@isNumber()@", + "identifier" : "@startsWith('KP_FT_')@", + "description" : "KP Integration Test Collection Content", + "ownershipType" : [ "createdBy" ], + "compatibilityLevel" : "@isNumber()@", + "audience" : [ "Learner" ], + "os" : [ "All" ], + "SYS_INTERNAL_LAST_UPDATED_ON" : "@matchesDatePattern('yyyy-MM-dd')@", + "downloadUrl" : "@ignore@", + "framework" : "NCF", + "totalCompressedSize" : "@isNumber()@", + "versionKey" : "@ignore@", + "mimeType" : "application/vnd.ekstep.content-collection", + "code" : "kp.ft.collection.textbook", + "license" : "CC BY 4.0", + "version" : "@isNumber()@", + "contentType" : "TextBook", + "language" : [ "English" ], + "lastPublishedOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "contentTypesCount" : "@ignore@", + "objectType" : "Content", + "lastUpdatedBy" : "KP_FT_PUBLISHER", + "status" : "Live", + "publisher" : "KP_FT_PUBLISHER", + "publishComment" : "OK", + "dialcodeRequired" : "No", + "idealScreenSize" : "normal", + "contentEncoding" : "gzip", + "leafNodesCount" : "@isNumber()@", + "depth" : 0, + "consumerId" : "@ignore@", + "lastPublishedBy" : "KP_FT_PUBLISHER", + "mimeTypesCount" : "@ignore@", + "osId" : "org.ekstep.quiz.app", + "s3Key" : "@ignore@", + "contentDisposition" : "inline", + "childNodes" : "@ignore@", + "visibility" : "Default", + "variants" : { + "online" : { + "ecarUrl" : "@ignore@", + "size" : "@isNumber()@" + }, + "spine" : { + "ecarUrl" : "@ignore@", + "size" : "@isNumber()@" + } + }, + "pkgVersion" : "@isNumber()@", + "idealScreenDensity" : "hdpi", + "collections": [ + ], + "leafNodes": "@ignore@", + "usedByContent": [ + ] + } + } +} \ No newline at end of file diff --git a/kp_service_test/src/test/resources/templates/content/v3/hierarchy/get/testGetHierarchyWithInvalidIdentifier/response.json b/kp_service_test/src/test/resources/templates/content/v3/hierarchy/get/testGetHierarchyWithInvalidIdentifier/response.json new file mode 100644 index 00000000..36e9505f --- /dev/null +++ b/kp_service_test/src/test/resources/templates/content/v3/hierarchy/get/testGetHierarchyWithInvalidIdentifier/response.json @@ -0,0 +1,14 @@ +{ + "id": "api.content.hierarchy.get", + "ver": "3.0", + "ts": "@matchesDatePattern('yyyy-MM-dd')@", + "params": { + "resmsgid": "@ignore@", + "msgid": null, + "err": "RESOURCE_NOT_FOUND", + "status": "failed", + "errmsg": "@ignore@" + }, + "responseCode": "RESOURCE_NOT_FOUND", + "result": {} +} \ No newline at end of file diff --git a/kp_service_test/src/test/resources/templates/content/v3/hierarchy/get/testGetHierarchyWithInvalidMode/response.json b/kp_service_test/src/test/resources/templates/content/v3/hierarchy/get/testGetHierarchyWithInvalidMode/response.json new file mode 100644 index 00000000..a8b90051 --- /dev/null +++ b/kp_service_test/src/test/resources/templates/content/v3/hierarchy/get/testGetHierarchyWithInvalidMode/response.json @@ -0,0 +1,153 @@ +{ + "id" : "api.content.hierarchy.get", + "ver" : "3.0", + "ts" : "@matchesDatePattern('yyyy-MM-dd')@", + "params" : { + "resmsgid" : "@ignore@", + "msgid" : null, + "err" : null, + "status" : "successful", + "errmsg" : null + }, + "responseCode" : "OK", + "result" : { + "content" : { + "lastStatusChangedOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "children" : [ { + "parent" : "@ignore@", + "identifier" : "@ignore@", + "lastStatusChangedOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "code" : "@ignore@", + "visibility" : "Parent", + "description" : "@ignore@", + "index" : 1, + "mimeType" : "application/vnd.ekstep.content-collection", + "createdOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "versionKey" : "@ignore@", + "depth" : 1, + "children" : [ { + "ownershipType" : [ "createdBy" ], + "previewUrl" : "@ignore@", + "code" : "kp.ft.resource.ecml", + "downloadUrl" : "@ignore@", + "channel" : "channel-01", + "description" : "KP Integration Test Content", + "language" : [ "English" ], + "variants" : { + "spine" : { + "ecarUrl" : "@ignore@", + "size" : "@isNumber()@" + } + }, + "streamingUrl" :"@ignore@", + "mimeType" : "application/vnd.ekstep.ecml-archive", + "idealScreenSize" : "normal", + "publishComment" : "OK", + "createdOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "contentDisposition" : "inline", + "artifactUrl" : "@ignore@", + "contentEncoding" : "gzip", + "lastUpdatedOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "SYS_INTERNAL_LAST_UPDATED_ON" : "@matchesDatePattern('yyyy-MM-dd')@", + "dialcodeRequired" : "No", + "contentType" : "Resource", + "lastUpdatedBy" : "KP_FT_PUBLISHER", + "identifier" : "@startsWith('KP_FT_')@", + "audience" : [ "Learner" ], + "lastStatusChangedOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "os" : [ "All" ], + "visibility" : "Default", + "consumerId" : "@ignore@", + "mediaType" : "content", + "osId" : "org.ekstep.quiz.app", + "lastPublishedBy" : "KP_FT_PUBLISHER", + "version" : "@isNumber()@", + "pkgVersion" : "@isNumber()@", + "versionKey" : "@ignore@", + "license" : "CC BY 4.0", + "idealScreenDensity" : "hdpi", + "s3Key" : "@ignore@", + "framework" : "NCF", + "size" : "@isNumber()@", + "lastPublishedOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "compatibilityLevel" : "@isNumber()@", + "name" : "KP Integration Test Content", + "publisher" : "KP_FT_PUBLISHER", + "status" : "Live", + "index" : 1, + "depth" : 2, + "parent" : "@ignore@" + } ], + "name" : "@ignore@", + "lastUpdatedOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "contentType" : "TextBook", + "status" : "Live", + "compatibilityLevel" : "@isNumber()@", + "lastPublishedOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "pkgVersion" : "@isNumber()@", + "leafNodesCount" : "@isNumber()@", + "downloadUrl" : "@ignore@", + "variants" : "@ignore@" + } ], + "mediaType" : "content", + "name" : "KP Integration Test Collection Content", + "toc_url" : "@ignore@", + "createdOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "channel" : "channel-01", + "lastUpdatedOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "size" : "@isNumber()@", + "identifier" : "${rootId}", + "description" : "KP Integration Test Collection Content", + "ownershipType" : [ "createdBy" ], + "compatibilityLevel" : "@isNumber()@", + "audience" : [ "Learner" ], + "os" : [ "All" ], + "collections" : [ ], + "SYS_INTERNAL_LAST_UPDATED_ON" : "@matchesDatePattern('yyyy-MM-dd')@", + "downloadUrl" : "@ignore@", + "usedByContent" : [ ], + "framework" : "NCF", + "totalCompressedSize" : "@isNumber()@", + "versionKey" : "@ignore@", + "mimeType" : "application/vnd.ekstep.content-collection", + "code" : "kp.ft.collection.textbook", + "license" : "CC BY 4.0", + "leafNodes" : "@ignore@", + "version" : "@isNumber()@", + "contentType" : "TextBook", + "language" : [ "English" ], + "lastPublishedOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "contentTypesCount" : "{\"Resource\":1,\"TextBook\":1}", + "objectType" : "Content", + "lastUpdatedBy" : "KP_FT_PUBLISHER", + "status" : "Live", + "publisher" : "KP_FT_PUBLISHER", + "publishComment" : "OK", + "dialcodeRequired" : "No", + "idealScreenSize" : "normal", + "contentEncoding" : "gzip", + "leafNodesCount" : "@isNumber()@", + "depth" : 0, + "consumerId" : "@ignore@", + "lastPublishedBy" : "KP_FT_PUBLISHER", + "mimeTypesCount" : "{\"application/vnd.ekstep.content-collection\":1,\"application/vnd.ekstep.ecml-archive\":1}", + "osId" : "org.ekstep.quiz.app", + "s3Key" : "@ignore@", + "contentDisposition" : "inline", + "childNodes" : "@ignore@", + "visibility" : "Default", + "variants" : { + "online" : { + "ecarUrl" : "@ignore@", + "size" : "@isNumber()@" + }, + "spine" : { + "ecarUrl" : "@ignore@", + "size" : "@isNumber()@" + } + }, + "pkgVersion" : "@isNumber()@", + "idealScreenDensity" : "hdpi" + } + } +} \ No newline at end of file diff --git a/kp_service_test/src/test/resources/templates/content/v3/hierarchy/get/testGetHierarchyWithNullMode/response.json b/kp_service_test/src/test/resources/templates/content/v3/hierarchy/get/testGetHierarchyWithNullMode/response.json new file mode 100644 index 00000000..a8b90051 --- /dev/null +++ b/kp_service_test/src/test/resources/templates/content/v3/hierarchy/get/testGetHierarchyWithNullMode/response.json @@ -0,0 +1,153 @@ +{ + "id" : "api.content.hierarchy.get", + "ver" : "3.0", + "ts" : "@matchesDatePattern('yyyy-MM-dd')@", + "params" : { + "resmsgid" : "@ignore@", + "msgid" : null, + "err" : null, + "status" : "successful", + "errmsg" : null + }, + "responseCode" : "OK", + "result" : { + "content" : { + "lastStatusChangedOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "children" : [ { + "parent" : "@ignore@", + "identifier" : "@ignore@", + "lastStatusChangedOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "code" : "@ignore@", + "visibility" : "Parent", + "description" : "@ignore@", + "index" : 1, + "mimeType" : "application/vnd.ekstep.content-collection", + "createdOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "versionKey" : "@ignore@", + "depth" : 1, + "children" : [ { + "ownershipType" : [ "createdBy" ], + "previewUrl" : "@ignore@", + "code" : "kp.ft.resource.ecml", + "downloadUrl" : "@ignore@", + "channel" : "channel-01", + "description" : "KP Integration Test Content", + "language" : [ "English" ], + "variants" : { + "spine" : { + "ecarUrl" : "@ignore@", + "size" : "@isNumber()@" + } + }, + "streamingUrl" :"@ignore@", + "mimeType" : "application/vnd.ekstep.ecml-archive", + "idealScreenSize" : "normal", + "publishComment" : "OK", + "createdOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "contentDisposition" : "inline", + "artifactUrl" : "@ignore@", + "contentEncoding" : "gzip", + "lastUpdatedOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "SYS_INTERNAL_LAST_UPDATED_ON" : "@matchesDatePattern('yyyy-MM-dd')@", + "dialcodeRequired" : "No", + "contentType" : "Resource", + "lastUpdatedBy" : "KP_FT_PUBLISHER", + "identifier" : "@startsWith('KP_FT_')@", + "audience" : [ "Learner" ], + "lastStatusChangedOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "os" : [ "All" ], + "visibility" : "Default", + "consumerId" : "@ignore@", + "mediaType" : "content", + "osId" : "org.ekstep.quiz.app", + "lastPublishedBy" : "KP_FT_PUBLISHER", + "version" : "@isNumber()@", + "pkgVersion" : "@isNumber()@", + "versionKey" : "@ignore@", + "license" : "CC BY 4.0", + "idealScreenDensity" : "hdpi", + "s3Key" : "@ignore@", + "framework" : "NCF", + "size" : "@isNumber()@", + "lastPublishedOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "compatibilityLevel" : "@isNumber()@", + "name" : "KP Integration Test Content", + "publisher" : "KP_FT_PUBLISHER", + "status" : "Live", + "index" : 1, + "depth" : 2, + "parent" : "@ignore@" + } ], + "name" : "@ignore@", + "lastUpdatedOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "contentType" : "TextBook", + "status" : "Live", + "compatibilityLevel" : "@isNumber()@", + "lastPublishedOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "pkgVersion" : "@isNumber()@", + "leafNodesCount" : "@isNumber()@", + "downloadUrl" : "@ignore@", + "variants" : "@ignore@" + } ], + "mediaType" : "content", + "name" : "KP Integration Test Collection Content", + "toc_url" : "@ignore@", + "createdOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "channel" : "channel-01", + "lastUpdatedOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "size" : "@isNumber()@", + "identifier" : "${rootId}", + "description" : "KP Integration Test Collection Content", + "ownershipType" : [ "createdBy" ], + "compatibilityLevel" : "@isNumber()@", + "audience" : [ "Learner" ], + "os" : [ "All" ], + "collections" : [ ], + "SYS_INTERNAL_LAST_UPDATED_ON" : "@matchesDatePattern('yyyy-MM-dd')@", + "downloadUrl" : "@ignore@", + "usedByContent" : [ ], + "framework" : "NCF", + "totalCompressedSize" : "@isNumber()@", + "versionKey" : "@ignore@", + "mimeType" : "application/vnd.ekstep.content-collection", + "code" : "kp.ft.collection.textbook", + "license" : "CC BY 4.0", + "leafNodes" : "@ignore@", + "version" : "@isNumber()@", + "contentType" : "TextBook", + "language" : [ "English" ], + "lastPublishedOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "contentTypesCount" : "{\"Resource\":1,\"TextBook\":1}", + "objectType" : "Content", + "lastUpdatedBy" : "KP_FT_PUBLISHER", + "status" : "Live", + "publisher" : "KP_FT_PUBLISHER", + "publishComment" : "OK", + "dialcodeRequired" : "No", + "idealScreenSize" : "normal", + "contentEncoding" : "gzip", + "leafNodesCount" : "@isNumber()@", + "depth" : 0, + "consumerId" : "@ignore@", + "lastPublishedBy" : "KP_FT_PUBLISHER", + "mimeTypesCount" : "{\"application/vnd.ekstep.content-collection\":1,\"application/vnd.ekstep.ecml-archive\":1}", + "osId" : "org.ekstep.quiz.app", + "s3Key" : "@ignore@", + "contentDisposition" : "inline", + "childNodes" : "@ignore@", + "visibility" : "Default", + "variants" : { + "online" : { + "ecarUrl" : "@ignore@", + "size" : "@isNumber()@" + }, + "spine" : { + "ecarUrl" : "@ignore@", + "size" : "@isNumber()@" + } + }, + "pkgVersion" : "@isNumber()@", + "idealScreenDensity" : "hdpi" + } + } +} \ No newline at end of file diff --git a/kp_service_test/src/test/resources/templates/content/v3/hierarchy/get/testGetHierarchyWithValidIdentifier/response.json b/kp_service_test/src/test/resources/templates/content/v3/hierarchy/get/testGetHierarchyWithValidIdentifier/response.json new file mode 100644 index 00000000..04629023 --- /dev/null +++ b/kp_service_test/src/test/resources/templates/content/v3/hierarchy/get/testGetHierarchyWithValidIdentifier/response.json @@ -0,0 +1,155 @@ +{ + "id" : "api.content.hierarchy.get", + "ver" : "3.0", + "ts" : "@matchesDatePattern('yyyy-MM-dd')@", + "params" : { + "resmsgid" : "@ignore@", + "msgid" : null, + "err" : null, + "status" : "successful", + "errmsg" : null + }, + "responseCode" : "OK", + "result" : { + "content" : { + "ownershipType" : [ "createdBy" ], + "downloadUrl" : "@ignore@", + "channel" : "channel-01", + "language" : [ "English" ], + "variants" : { + "online" : { + "ecarUrl" : "@ignore@", + "size" : "@isNumber()@" + }, + "spine" : { + "ecarUrl" : "@ignore@", + "size" : "@isNumber()@" + } + }, + "mimeType" : "application/vnd.ekstep.content-collection", + "leafNodes" : "@ignore@", + "objectType" : "Content", + "children" : [ { + "parent" : "@ignore@", + "identifier" : "@ignore@", + "lastStatusChangedOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "code" : "@ignore@", + "visibility" : "Parent", + "description" : "@ignore@", + "index" : 1, + "mimeType" : "application/vnd.ekstep.content-collection", + "createdOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "versionKey" : "@ignore@", + "depth" : 1, + "children" : [ { + "ownershipType" : [ "createdBy" ], + "parent": "@ignore@", + "previewUrl" : "@ignore@", + "downloadUrl" : "@ignore@", + "channel" : "channel-01", + "questions" : [ ], + "language" : [ "English" ], + "variants" : "@ignore@", + "mimeType" : "application/vnd.ekstep.ecml-archive", + "usesContent" : [ ], + "artifactUrl" : "@ignore@", + "contentEncoding" : "gzip", + "contentType" : "Resource", + "item_sets" : [ ], + "lastUpdatedBy" : "KP_FT_PUBLISHER", + "identifier" : "@ignore@", + "audience" : [ "Learner" ], + "visibility" : "Default", + "consumerId" : "@ignore@", + "mediaType" : "content", + "osId" : "org.ekstep.quiz.app", + "lastPublishedBy" : "KP_FT_PUBLISHER", + "version" : 2, + "license" : "CC BY 4.0", + "size" : "@isNumber()@", + "lastPublishedOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "concepts" : [ ], + "name" : "KP Integration Test Content", + "publisher" : "KP_FT_PUBLISHER", + "status" : "Live", + "code" : "@ignore@", + "methods" : [ ], + "description" : "KP Integration Test Content", + "streamingUrl" :"@ignore@", + "idealScreenSize" : "normal", + "publishComment" : "OK", + "createdOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "contentDisposition" : "inline", + "lastUpdatedOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "SYS_INTERNAL_LAST_UPDATED_ON" : "@matchesDatePattern('yyyy-MM-dd')@", + "dialcodeRequired" : "No", + "lastStatusChangedOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "os" : [ "All" ], + "libraries" : [ ], + "pkgVersion" : 1.0, + "versionKey" : "@ignore@", + "idealScreenDensity" : "hdpi", + "s3Key" : "@ignore@", + "framework" : "NCF", + "compatibilityLevel" : 1, + "index" : 1, + "depth" : 2 + } ], + "name" : "@ignore@", + "lastUpdatedOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "contentType" : "TextBook", + "status" : "Live", + "compatibilityLevel" : 1, + "lastPublishedOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "pkgVersion" : 2.0, + "leafNodesCount" : 1, + "downloadUrl" : "@ignore@", + "variants" : "@ignore@" + } ], + "contentEncoding" : "gzip", + "mimeTypesCount" : "{\"application/vnd.ekstep.content-collection\":1,\"application/vnd.ekstep.ecml-archive\":1}", + "totalCompressedSize" : "@isNumber()@", + "contentType" : "TextBook", + "lastUpdatedBy" : "KP_FT_PUBLISHER", + "identifier" : "${rootId}", + "audience" : [ "Learner" ], + "toc_url" : "@ignore@", + "visibility" : "Default", + "contentTypesCount" : "{\"Resource\":1,\"TextBook\":1}", + "childNodes" : "@ignore@", + "consumerId" : "@ignore@", + "mediaType" : "content", + "osId" : "org.ekstep.quiz.app", + "lastPublishedBy" : "KP_FT_PUBLISHER", + "version" : 2, + "license" : "CC BY 4.0", + "size" : "@isNumber()@", + "lastPublishedOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "name" : "KP Integration Test Collection Content", + "publisher" : "KP_FT_PUBLISHER", + "status" : "Live", + "code" : "kp.ft.collection.textbook", + "description" : "KP Integration Test Collection Content", + "publishComment" : "OK", + "idealScreenSize" : "normal", + "createdOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "contentDisposition" : "inline", + "lastUpdatedOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "SYS_INTERNAL_LAST_UPDATED_ON" : "@matchesDatePattern('yyyy-MM-dd')@", + "dialcodeRequired" : "No", + "lastStatusChangedOn" : "@matchesDatePattern('yyyy-MM-dd')@", + "os" : [ "All" ], + "pkgVersion" : 2.0, + "versionKey" : "@ignore@", + "idealScreenDensity" : "hdpi", + "depth" : 0, + "s3Key" : "@ignore@", + "framework" : "NCF", + "leafNodesCount" : 1, + "compatibilityLevel" : 1, + "collections": [ + ], + "usedByContent" : [ ] + } + } +} \ No newline at end of file diff --git a/kp_service_test/src/test/resources/templates/payload/content/createCollectionContentExpect200/request.json b/kp_service_test/src/test/resources/templates/payload/content/createCollectionContentExpect200/request.json index 3c81b72c..fdec3f07 100644 --- a/kp_service_test/src/test/resources/templates/payload/content/createCollectionContentExpect200/request.json +++ b/kp_service_test/src/test/resources/templates/payload/content/createCollectionContentExpect200/request.json @@ -7,7 +7,8 @@ "code": "${codeVal}", "mimeType": "application/vnd.ekstep.content-collection", "contentType": "${contentTypeVal}", - "mediaType": "content" + "mediaType": "content", + "license":"CC BY 4.0" } } } \ No newline at end of file