I'm literally pulling my hair out... I have this Apex Class:
public with sharing class ProviderAPI_Datatype {
Public Class Customer {
@AuraEnabled
Public String CustomerName {get;set;}
@AuraEnabled
Public String SfID{get;set;}
@AuraEnabled
Public string TaxID{get;set;}
@AuraEnabled
Public string CustID{get;set;}
@AuraEnabled
Public Date LastPmtDate{get;set;}
}
}
And I have this test method
@isTest(seealldata=true)
public class ProviderAPI_Datatype_Test {
static testMethod ProviderAPI_Datatype.Customer CustomerObj() {
StaticResource sr = [SELECT body FROM StaticResource WHERE Name = 'Customer3281'];// - Need to get sample JSON from Orion system.
String fullJson = sr.body.toString();
ProviderAPI_Datatype.Customer CustomerResults = (ProviderAPI_Datatype.Customer)JSON.deserialize(fullJson, ProviderAPI_Datatype.Customer.class);
return CustomerResults;
}
}
The static resource is a copy of the correct JSON for this, and I am getting 0% code coverage... What am I doing wrong? (besides seealldata true ;) )
StaticResource
is available w/o needingseeAllData=true
– cropredy Jan 20 '20 at 23:24