This is my aura method to retrieve fields for dual list box.
@AuraEnabled
public static List <String> getProperties(sObject objObject, string sFieldAPI) {
List < String > lstOptions = new list < String > ();
Schema.sObjectType objType = objObject.getSObjectType();
Schema.DescribeSObjectResult objDescribe = objType.getDescribe();
map <String, Schema.SObjectField> fieldMap = objDescribe.fields.getMap();
list < Schema.PicklistEntry > values =fieldMap.get(sFieldAPI).getDescribe().getPickListValues();
for (Schema.PicklistEntry a: values) {
lstOptions.add(a.getValue());
}
lstOptions.sort();
return lstOptions;
}
And this is the test class where I'm getting error.
testMethod static void testGetProperties(){
setupInsertData();
Test.startTest();
List<String> Prop = MessageTypeController.getProperties('isArray');
System.debug('Test Category'+Prop);
if(Prop!=null){
System.assertEquals(Prop!=null,true);
}else{
System.assertEquals(Prop==null,true);
}
Test.stopTest();
}
The text of the error is:
"Method does not exist or incorrect signature: void getProperties(String)"
With this now it's working: