I am trying to increase my code coverage, I have only provided parts of my code that I am trying to cover. I have to create a List to be able to pass over my values into the method. My Errors I have listed below.
- Expecting'<' but was '('
- Invalid type: AccountParameter
method does not exist or incorrect signature void handleNewAccounts(List) from the type ProcessHandlerShowAccounts
@isTest public class ProcessHandlerShowAccountsTest { @isTest static void testCallout() { ProcessHandlerShowAccounts.AccountParameter testAccount = new ProcessHandlerShowAccounts.AccountParameter(); testAccount.accountId = '0010Z00000schfZZZZ'; testAccount.name = 'create'; //I get my 1st two errors here LIST<AccountParameter> testActLst = new LIST(); //I get my last error here ProcessHandlerShowAccounts.handleNewAccounts(testActLst); } }
Method I am trying to call lives within this Class
public class ProcessHandlerShowAccounts
{
public class AccountParameter
{
@InvocableVariable(required=true)
public Id accountId;
@InvocableVariable(required=true)
public String name;
}
public static void handleNewAccounts(AccountParameter [] accountParameters)
{
webServiceCallOut(accountParameters[0].accountId,accountParameters[0].name);
isAlreadyRun=true;
}
}