Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ private List<Map<String, Object>> processCoursesForCbPlan(
Map<String, Object> contentDetails = null;


contentDetails = contentService.readContent(courseId, null);
contentDetails = contentService.readContent(courseId, serverProperties.getCbPlanContentReadFields());

if (MapUtils.isNotEmpty(contentDetails)) {
if (courseId.contains("_rc")) {
Expand Down
7 changes: 7 additions & 0 deletions src/main/java/com/igot/cb/util/CbExtServerProperties.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,11 @@ public List<String> getCbPlanUpdateAllowedFields() {

@Value("${promotional.content.cache.max.query.size}")
private int promotionalContentCacheMaxQuerySize;

@Value("${cb-plan.content.read.fields}")
private String cbPlanContentReadFields;

public List<String> getCbPlanContentReadFields() {
return Arrays.asList(cbPlanContentReadFields.split(",", -1));
}
}
4 changes: 3 additions & 1 deletion src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,6 @@ cios.search.offset=0
cios.integration.search.host=http://localhost:7002
cios.integration.search=/ciosIntegration/v1/search/content
external.content.read.endpoint=/cios/v1/content/read
cbpores.service.host=http://localhost:7001
cbpores.service.host=http://localhost:7001

cb-plan.content.read.fields=ownershipType,cqfVersion,instructions,keywords,creatorContacts,channel,organisation,parentCollections,language,source,mimeType,leafNodes,cqfIdentifier,objectType,appIcon,primaryCategory,languageMapV1,contentEncoding,generateDIALCodes,totalCompressedSize,mimeTypesCount,sYS_INTERNAL_LAST_UPDATED_ON,contentType,trackable,identifier,audience,toc_url,isExternal,visibility,contentTypesCount,consumerId,childNodes,discussionForum,mediaType,sectorDetails_v1,osId,lastPublishedBy,languageCode,version,license,prevState,lastPublishedOn,name,creatorIDs,reviewStatus,status,competencies_v6,code,credentials,prevStatus,difficultyLevel,description,posterImage,idealScreenSize,createdOn,courseCategory,duration,creatorDetails,batches,demand_id,contentDisposition,lastUpdatedOn,contextLockingType,dialcodeRequired,lastStatusChangedOn,createdFor,creator,os,se_FWIds,referenceNodes,reviewer,pkgVersion,versionKey,reviewerIDs,idealScreenDensity,accessSetting,framework,depth,s3Key,lastSubmittedOn,createdBy,compatibilityLevel,leafNodesCount,userConsent,maxUserInBatch
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.igot.cb.cassandra.CassandraOperation;
import com.igot.cb.model.ApiResponse;
import com.igot.cb.util.AccessTokenValidator;
import com.igot.cb.util.CbExtServerProperties;
import com.igot.cb.util.Constants;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
Expand Down Expand Up @@ -43,6 +44,9 @@ class CbPlanLearnerServiceImplTest {
@Mock(lenient = true)
private RedisCacheMgr redisCacheMgr;

@Mock(lenient = true)
private CbExtServerProperties serverProperties;


private CbPlanLearnerServiceImpl service;

Expand All @@ -51,6 +55,8 @@ void setUp() {
service = new CbPlanLearnerServiceImpl(accessTokenValidator, cassandraOperation, cbPlanCacheMgr);
ReflectionTestUtils.setField(service, "contentService", contentService);
ReflectionTestUtils.setField(service, "redisCacheMgr", redisCacheMgr);
ReflectionTestUtils.setField(service, "serverProperties", serverProperties);
when(serverProperties.getCbPlanContentReadFields()).thenReturn(Arrays.asList("identifier", "name", "status"));
}


Expand Down