diff --git a/.circleci/config.yml b/.circleci/config.yml
index 2ef79658b..22eeb8658 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -27,8 +27,15 @@ jobs:
- restore_cache:
key: kp-dependency-test-cache-{{ checksum "pom.xml" }}
- run:
- name: Setup environment and run tests
- command: bash vmsetup.sh
+ name: Save test results
+ command: |
+ mkdir -p ~/test-results/junit/
+ find . -type f -regex ".*/target/surefire-reports/.*xml" -exec cp {} ~/test-results/junit/ \;
+ when: always
+ - store_test_results:
+ path: ~/test-results
+ - store_artifacts:
+ path: ~/test-results/junit
- save_cache:
paths:
- ~/.m2
diff --git a/content-api/content-actors/src/main/scala/org/sunbird/content/actors/ContentActor.scala b/content-api/content-actors/src/main/scala/org/sunbird/content/actors/ContentActor.scala
index 4d8892a79..f5ff747ff 100644
--- a/content-api/content-actors/src/main/scala/org/sunbird/content/actors/ContentActor.scala
+++ b/content-api/content-actors/src/main/scala/org/sunbird/content/actors/ContentActor.scala
@@ -3,8 +3,8 @@ package org.sunbird.content.actors
import java.util
import java.util.concurrent.CompletionException
import java.io.File
-
import org.apache.commons.io.FilenameUtils
+
import javax.inject.Inject
import org.apache.commons.lang3.StringUtils
import org.sunbird.`object`.importer.{ImportConfig, ImportManager}
@@ -16,6 +16,7 @@ import org.sunbird.common.{ContentParams, Platform, Slug}
import org.sunbird.common.dto.{Request, Response, ResponseHandler}
import org.sunbird.common.exception.ClientException
import org.sunbird.content.dial.DIALManager
+import org.sunbird.content.mgr.ImportManager
import org.sunbird.util.RequestUtil
import org.sunbird.content.upload.mgr.UploadManager
import org.sunbird.graph.OntologyEngineContext
diff --git a/content-api/content-actors/src/main/scala/org/sunbird/content/util/RetireManager.scala b/content-api/content-actors/src/main/scala/org/sunbird/content/util/RetireManager.scala
index cbd8e4eba..360fcb567 100644
--- a/content-api/content-actors/src/main/scala/org/sunbird/content/util/RetireManager.scala
+++ b/content-api/content-actors/src/main/scala/org/sunbird/content/util/RetireManager.scala
@@ -57,7 +57,7 @@ object RetireManager {
private def updateNodesToRetire(request: Request, updateMetadataMap: util.Map[String, AnyRef])(implicit ec: ExecutionContext, oec: OntologyEngineContext): Future[Response] = {
RedisCache.delete(request.get(ContentConstants.IDENTIFIER).asInstanceOf[String])
val updateReq = new Request(request)
- updateReq.put(ContentConstants.IDENTIFIERS, java.util.Arrays.asList(request.get(ContentConstants.IDENTIFIER).asInstanceOf[String], request.get(ContentConstants.IDENTIFIER).asInstanceOf[String] + HierarchyConstants.IMAGE_SUFFIX))
+ updateReq.put(ContentConstants.IDENTIFIERS, java.util.Arrays.asList(request.get(ContentConstants.IDENTIFIER).asInstanceOf[String]))
updateReq.put(ContentConstants.METADATA, updateMetadataMap)
DataNode.bulkUpdate(updateReq).map(node => ResponseHandler.OK())
}
diff --git a/content-api/content-service/app/controllers/v3/ContentController.scala b/content-api/content-service/app/controllers/v3/ContentController.scala
index 6a7abdd35..c08c08057 100644
--- a/content-api/content-service/app/controllers/v3/ContentController.scala
+++ b/content-api/content-service/app/controllers/v3/ContentController.scala
@@ -8,14 +8,16 @@ import org.sunbird.models.UploadParams
import org.sunbird.common.dto.ResponseHandler
import play.api.mvc.ControllerComponents
import utils.{ActorNames, ApiId, JavaJsonUtils}
-
+import org.slf4j.LoggerFactory
+import com.fasterxml.jackson.databind.ObjectMapper
import scala.collection.JavaConverters._
import scala.concurrent.{ExecutionContext, Future}
@Singleton
class ContentController @Inject()(@Named(ActorNames.CONTENT_ACTOR) contentActor: ActorRef, @Named(ActorNames.COLLECTION_ACTOR) collectionActor: ActorRef, cc: ControllerComponents, actorSystem: ActorSystem)(implicit exec: ExecutionContext) extends BaseController(cc) {
-
+ val LOG = LoggerFactory.getLogger(classOf[ContentController])
+ val mapper = new ObjectMapper();
val objectType = "Content"
val schemaName: String = "content"
val version = "1.0"
@@ -24,6 +26,7 @@ class ContentController @Inject()(@Named(ActorNames.CONTENT_ACTOR) contentActor:
val headers = commonHeaders()
val body = requestBody()
val content = body.getOrDefault("content", new java.util.HashMap()).asInstanceOf[java.util.Map[String, Object]];
+ LOG.warn("Content create request : {}", mapper.writeValueAsString(content))
content.putAll(headers)
val contentRequest = getRequest(content, headers, "createContent", true)
setRequestContext(contentRequest, version, objectType, schemaName)
@@ -56,6 +59,7 @@ class ContentController @Inject()(@Named(ActorNames.CONTENT_ACTOR) contentActor:
val headers = commonHeaders()
val body = requestBody()
val content = body.getOrDefault("content", new java.util.HashMap()).asInstanceOf[java.util.Map[String, Object]];
+ LOG.warn("Content Update request : {}", mapper.writeValueAsString(content))
content.putAll(headers)
val contentRequest = getRequest(content, headers, "updateContent")
setRequestContext(contentRequest, version, objectType, schemaName)
@@ -69,6 +73,7 @@ class ContentController @Inject()(@Named(ActorNames.CONTENT_ACTOR) contentActor:
body.putAll(headers)
val contentRequest = getRequest(body, headers, "addHierarchy")
contentRequest.put("mode", "edit");
+ LOG.warn("Add Hierarchy request : {}", mapper.writeValueAsString(contentRequest))
setRequestContext(contentRequest, version, objectType, schemaName)
getResult(ApiId.ADD_HIERARCHY, collectionActor, contentRequest)
}
@@ -89,6 +94,7 @@ class ContentController @Inject()(@Named(ActorNames.CONTENT_ACTOR) contentActor:
val data = body.getOrDefault("data", new java.util.HashMap()).asInstanceOf[java.util.Map[String, Object]]
data.putAll(headers)
val contentRequest = getRequest(data, headers, "updateHierarchy")
+ LOG.warn("Update Hierarchy request : {}", mapper.writeValueAsString(contentRequest))
setRequestContext(contentRequest, version, objectType, schemaName)
getResult(ApiId.UPDATE_HIERARCHY, collectionActor, contentRequest)
}
diff --git a/content-api/content-service/test/modules/TestModule.scala b/content-api/content-service/test/modules/TestModule.scala
index 938b737e2..3a6f73ddb 100644
--- a/content-api/content-service/test/modules/TestModule.scala
+++ b/content-api/content-service/test/modules/TestModule.scala
@@ -18,6 +18,7 @@ class TestModule extends AbstractModule with AkkaGuiceSupport {
bindActor(classOf[TestActor], ActorNames.CHANNEL_ACTOR)
bindActor(classOf[TestActor], ActorNames.CATEGORY_ACTOR)
bindActor(classOf[TestActor], ActorNames.ASSET_ACTOR)
+
bindActor(classOf[TestActor], ActorNames.APP_ACTOR)
bindActor(classOf[TestActor], ActorNames.EVENT_SET_ACTOR)
bindActor(classOf[TestActor], ActorNames.EVENT_ACTOR)
diff --git a/definition-scripts/Goals.sh b/definition-scripts/Goals.sh
index 8af8ecb83..835dd71b5 100644
--- a/definition-scripts/Goals.sh
+++ b/definition-scripts/Goals.sh
@@ -49,4 +49,4 @@ curl -L -X POST '{{host}}/object/category/definition/v4/create' \
}
}
}
-}'
\ No newline at end of file
+}'
diff --git a/definition-scripts/Playlist.sh b/definition-scripts/Playlist.sh
index 42d59b808..6150ee430 100644
--- a/definition-scripts/Playlist.sh
+++ b/definition-scripts/Playlist.sh
@@ -49,4 +49,4 @@ curl -L -X POST '{{host}}/object/category/definition/v4/create' \
}
}
}
-}'
\ No newline at end of file
+}'
diff --git a/definition-scripts/master_category_create b/definition-scripts/master_category_create
index f412bcd5d..c37d592b9 100644
--- a/definition-scripts/master_category_create
+++ b/definition-scripts/master_category_create
@@ -20,6 +20,18 @@ curl --location --request POST '{{host}}/object/category/v4/create' \
}
}'
+curl --location --request POST '{{host}}/object/category/v4/create' \
+--header 'Content-Type: application/json' \
+--data-raw '{
+ "request": {
+ "objectCategory": {
+ "name": "Goals",
+ "description":"Goals for Users"
+ }
+ }
+}'
+
+
curl --location --request POST '{{host}}/object/category/v4/create' \
--header 'Content-Type: application/json' \
--data-raw '{
@@ -374,4 +386,4 @@ curl --location --request POST '{{host}}/object/category/v4/create' \
"description":"FTB Question"
}
}
-}'
\ No newline at end of file
+}'
diff --git a/platform-modules/mimetype-manager/pom.xml b/platform-modules/mimetype-manager/pom.xml
index eb25c58f1..a11b081fb 100644
--- a/platform-modules/mimetype-manager/pom.xml
+++ b/platform-modules/mimetype-manager/pom.xml
@@ -13,8 +13,22 @@
2.11
2.7.2
-
+
+
org.sunbird
platform-common
@@ -143,4 +157,4 @@
-
\ No newline at end of file
+
diff --git a/platform-modules/mimetype-manager/src/main/scala/org/sunbird/cloudstore/StorageService.scala b/platform-modules/mimetype-manager/src/main/scala/org/sunbird/cloudstore/StorageService.scala
index 405217526..e4a44c9b0 100644
--- a/platform-modules/mimetype-manager/src/main/scala/org/sunbird/cloudstore/StorageService.scala
+++ b/platform-modules/mimetype-manager/src/main/scala/org/sunbird/cloudstore/StorageService.scala
@@ -34,7 +34,6 @@ class StorageService {
val storageSecret = Platform.config.getString("cephs3_storage_secret")
val endpoint = Platform.config.getString("cephs3_storage_endpoint")
storageService = StorageServiceFactory.getStorageService(new StorageConfig(storageType, storageKey, storageSecret, Option(endpoint)))
-
}
else throw new ServerException("ERR_INVALID_CLOUD_STORAGE", "Error while initialising cloud storage")
}
diff --git a/platform-modules/mimetype-manager/src/main/scala/org/sunbird/mimetype/mgr/impl/HtmlMimeTypeMgrImpl.scala b/platform-modules/mimetype-manager/src/main/scala/org/sunbird/mimetype/mgr/impl/HtmlMimeTypeMgrImpl.scala
index 80df3773e..cfa8f6452 100644
--- a/platform-modules/mimetype-manager/src/main/scala/org/sunbird/mimetype/mgr/impl/HtmlMimeTypeMgrImpl.scala
+++ b/platform-modules/mimetype-manager/src/main/scala/org/sunbird/mimetype/mgr/impl/HtmlMimeTypeMgrImpl.scala
@@ -8,6 +8,7 @@ import org.sunbird.common.exception.ClientException
import org.sunbird.graph.dac.model.Node
import org.sunbird.mimetype.mgr.{BaseMimeTypeManager, MimeTypeManager}
import org.sunbird.telemetry.logger.TelemetryManager
+import org.sunbird.common.Platform
import scala.concurrent.{ExecutionContext, Future}
@@ -15,7 +16,9 @@ class HtmlMimeTypeMgrImpl(implicit ss: StorageService) extends BaseMimeTypeManag
override def upload(objectId: String, node: Node, uploadFile: File, filePath: Option[String], params: UploadParams)(implicit ec: ExecutionContext): Future[Map[String, AnyRef]] = {
validateUploadRequest(objectId, node, uploadFile)
- if (isValidPackageStructure(uploadFile, List[String]("index.html"))) {
+ val indexHtmlValidation: Boolean = if (Platform.config.hasPath("indexHtmlValidation.env")) Platform.config.getBoolean("indexHtmlValidation.env") else false
+ val flag: Boolean = if (indexHtmlValidation) isValidPackageStructure(uploadFile, List[String]("index.html")) else true
+ if (flag) {
val urls = uploadArtifactToCloud(uploadFile, objectId, filePath)
node.getMetadata.put("s3Key", urls(IDX_S3_KEY))
node.getMetadata.put("artifactUrl", urls(IDX_S3_URL))
diff --git a/schemas/asset/1.0/schema.json b/schemas/asset/1.0/schema.json
index b8cf5afdb..2dc8ec3ff 100644
--- a/schemas/asset/1.0/schema.json
+++ b/schemas/asset/1.0/schema.json
@@ -1249,4 +1249,4 @@
}
}
}
-}
\ No newline at end of file
+}
diff --git a/schemas/collection/1.0/schema.json b/schemas/collection/1.0/schema.json
index 814bbdd32..0d325c221 100644
--- a/schemas/collection/1.0/schema.json
+++ b/schemas/collection/1.0/schema.json
@@ -1269,4 +1269,4 @@
}
}
}
-}
\ No newline at end of file
+}
diff --git a/schemas/content/1.0/schema.json b/schemas/content/1.0/schema.json
index 2587f5b71..3cb4e7a4b 100644
--- a/schemas/content/1.0/schema.json
+++ b/schemas/content/1.0/schema.json
@@ -87,7 +87,8 @@
"audio/webm",
"audio/x-wav",
"audio/wav",
- "application/json"
+ "application/json",
+ "application/quiz"
]
},
"osId": {
@@ -1370,4 +1371,4 @@
}
}
}
-}
\ No newline at end of file
+}
diff --git a/search-api/search-actors/src/main/java/org/sunbird/actors/SearchActor.java b/search-api/search-actors/src/main/java/org/sunbird/actors/SearchActor.java
index 708516c04..e5f171083 100644
--- a/search-api/search-actors/src/main/java/org/sunbird/actors/SearchActor.java
+++ b/search-api/search-actors/src/main/java/org/sunbird/actors/SearchActor.java
@@ -106,6 +106,9 @@ private SearchDTO getSearchDTO(Request request) throws Exception {
wordChainsRequest = false;
List