function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Steve LoudermilkSteve Loudermilk 

connectapi test issues

global class SignOffController {
    Daily_Crane_Ticket__c ticket {get; set; }
    global SignOffCOntroller(ApexPages.StandardController controller){
        ticket = (Daily_Crane_Ticket__c)controller.getRecord();
    }
    @RemoteAction
    global static void submitSignature(String name, String body, String parentId, String fullName, String email){
       
        ConnectApi.FeedItemInput input = new ConnectApi.FeedItemInput();
        input.subjectId = parentId;
        
        ConnectApi.ContentCapabilityInput contentInput = new ConnectApi.ContentCapabilityInput();
        contentInput.title = 'Signature';
        
        ConnectApi.FeedElementCapabilitiesInput capabilities = new ConnectApi.FeedElementCapabilitiesInput();
        capabilities.content = contentInput;
        
        input.capabilities = capabilities;
        
        Blob myBlob = EncodingUtil.base64Decode(body);
        ConnectApi.BinaryInput binInput = new ConnectApi.BinaryInput(myBlob, 'img/png', 'Site Check-In.png');
        
        ConnectApi.ChatterFeeds.postFeedElement(Network.getNetworkId(), input, binInput);
        
        Daily_Crane_Ticket__c ticket = new Daily_Crane_Ticket__c();
        try{
            ticket = [SELECT Id,Signer_Name__c,Signer_Email__c FROM Daily_Crane_Ticket__c WHERE Id = :parentId][0];
        } catch (QueryException e){
            System.Debug(e);
        }
        if(ticket != null){
            ticket.Signer_Email__c = email;
            ticket.Signer_Name__c = fullName;
        	update ticket;
        }
        
        //return a.Id;

        
    }
This some code one of my colleagues put together last year so it runs off an older version of the API(v35.0).  I am having issues with testing this code and I've taken several shots at I just can't seem to get it figured out.  I'm fairly new to apex and need some direction or help here.  I've looked through the documentation on the subject as well as some Github resources.

Thanks in advance.