You need to sign in to do that
Don't have an account?
AMIT KUMAR 73
Test Class for ServiceMax custom Apex Code
Hi,
I have written a custom apex code for web service integration. Input parameter is the RecordID.
The functionality working fine but i am unable to achieve code coverage since i am unable to pass the Input parameter to my method "sfmOperation".
global class ServiceMaxOutbound{
webservice static SVMXC.INTF_WebServicesDef.INTF_Response sfmOperation(SVMXC.INTF_We bServicesDef.INTF_Response request)
{
String recordId,logDescription;
List<SVMXC__Service_Order__c> listWO;
for(SVMXC.INTF_WebServicesDef.SVMXMap objSVXMMap : request.valueMap) { if(objSVXMMap.key == 'WorkOrder_ID'){
recordId = objSVXMMap.value;
}
}
Any suggestions will be highly appreciated as can't find any doc on how to write test classes for servicemax apex class.
I have written a custom apex code for web service integration. Input parameter is the RecordID.
The functionality working fine but i am unable to achieve code coverage since i am unable to pass the Input parameter to my method "sfmOperation".
global class ServiceMaxOutbound{
webservice static SVMXC.INTF_WebServicesDef.INTF_Response sfmOperation(SVMXC.INTF_We bServicesDef.INTF_Response request)
{
String recordId,logDescription;
List<SVMXC__Service_Order__c> listWO;
for(SVMXC.INTF_WebServicesDef.SVMXMap objSVXMMap : request.valueMap) { if(objSVXMMap.key == 'WorkOrder_ID'){
recordId = objSVXMMap.value;
}
}
Any suggestions will be highly appreciated as can't find any doc on how to write test classes for servicemax apex class.
webservice static SVMXC.SFM_WrapperDef.SFM_PageData processHeader(SVMXC.SFM_WrapperDef.SFM_TargetRecord request)
I have to reverse engineer request object that needs to be parsed in the method. Any help will e appreciated. Please reply to nagendrat@slalom.com
List<SVMXC.INTF_WebServicesDef.SVMXMap> testMapList = new List<SVMXC.INTF_WebServicesDef.SVMXMap>();
SVMXC.INTF_WebServicesDef.SVMXMap testmap = new SVMXC.INTF_WebServicesDef.SVMXMap();
testmap.key = 'WorkOrder_ID';
testmap.value = workOrderId; //create workOrder and assign its id here
testMapList.add(testmap);
SVMXC.INTF_WebServicesDef.INTF_Request request = new SVMXC.INTF_WebServicesDef.INTF_Request();
request.valueMap = testMapList;
System.assert(ServiceMaxOutbound.sfmOperation(request)!= null);
Please upvote!!!