You need to sign in to do that
Don't have an account?

Failing pkb_mobile_Test (Assertion Failed)
I am trying to make a very simple code change to something completely unrelated to the Public Knowledge Base App (third party from app exchange) and I am getting the following error that is preventing me from deploying:
System.AssertException: Assertion Failed
class.pkb_mobile_Test.test_getArticleDetail: line 290, column 1
I checked out the code for this and the whole test looks like so:
I have not made any code changes to any of the PKB code, so I have to assume it is something in setup in the UI. Any help would be greatly appreciated.
Thanks!
System.AssertException: Assertion Failed
class.pkb_mobile_Test.test_getArticleDetail: line 290, column 1
I checked out the code for this and the whole test looks like so:
//public static pkb_mobile_proxy.ResponseItem getArticleDetail(pkb_mobile_proxy.RequestItem req){ @isTest(SeeAllData=true) static void test_getArticleDetail() { pkb_mobile_proxy.ResponseItem resp = null; //with setup populatePKB2Environment(); PKB__c pkS = populateSetup(); pkb_Controller.DEFAULT_SITE_NAME = siteName; pkb_Controller pc = pkb_mobile_controller.setUp(); //build request object pkb_mobile_proxy.RequestItem req = new pkb_mobile_proxy.RequestItem(); req.lang = KnowledgeArticleVersion.Language.getDescribe().getPickListValues().get(0).getValue(); req.operationType = 'getArticleDetail'; req.sessionId = 'TESTSESSION'; req.searchCriteria = String.valueOf(kavObj.get('KnowledgeArticleId')); resp = pkb_mobile_controller.getArticleDetail(req); system.assert(resp.isSuccess); Map<String,String> fieldValues = (Map<String,String>)resp.articleData.fieldValues; String kavTitle = String.valueOf(kavObj.get('title')); String resultTitle = resp.articleData.title; system.assert( resultTitle.contains(kavtitle)); //with null request resp = pkb_mobile_controller.getArticleDetail(null); system.assert(!resp.isSuccess); }
I have not made any code changes to any of the PKB code, so I have to assume it is something in setup in the UI. Any help would be greatly appreciated.
Thanks!
Here's a workaround which worked in a specific case, and you might want to give it a try. You may have to make a little modification in the "pkb_mobile_controller" apex class as a workaround to resolve this issue.
There should be a line in the class like below:
Select id,knowledgearticleid,ownerid,isdeleted,title,lastmodifieddate,articlenumber,summary,KnowledgeArticleId from Admissions_Macros__kav WHERE Id = 'ka2550000004CGtAAM' limit 1
You will notice here that knowledgearticleid is mentioned twice in the query. Please try removing one of it and see if it resolves the issue. If that doesn't work, please try commenting out the whole line and see if it helps.
Thanks,
Shivani