---
schema_version: "1"
id: c7a7a342695f4290fee6c021544d461fd24f658cac41045f32bbbd683b784da2
title: Integration Procedure Unit Testing from Apex
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/xcloud/264-0-0/os_integration_procedure_unit_testing_from_apex_55739.md
canonical_url: https://help.salesforce.com/s/articleView?id=xcloud.os_integration_procedure_unit_testing_from_apex_55739.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: f170e0ef8b71529c1a065ba39b7fa2f312effa55c668e07f94c51ca67a9120f5
description: You can set up a test class in Apex and use it to call and test an Integration Procedure. In the core runtime, HTTP mocking isn’t possible, and real HTTP calls occur during test execution.
products:
  - Omnistudio
release: "264"
---
# Integration Procedure Unit Testing from Apex

You can set up a test class in Apex and use it to call and test an Integration Procedure. In the core runtime, HTTP mocking isn’t possible, and real HTTP calls occur during test execution.

The following is an example unit test of an Integration Procedure:

```
@isTest(seeAllData=true)
global with sharing class TestIntegrationProcedure
{
    static testMethod void testIP()
    {
        Map<String, Object> inputMap = new Map<String, Object>();
        inputMap.put('AccountName', 'Acme');
        ConnectAPI.IntegrationProcedureServiceRunInputRepresentation apexInput = new ConnectAPI.IntegrationProcedureServiceRunInputRepresentation();
        List<String> stringList = new List<String>();
        String serializedInputMap = JSON.serialize(inputMap);
        stringList.add(serializedInputMap);
        apexInput.input = stringList;

        ConnectAPI.IntegrationProcedureServiceRunOutputRepresentation output = ConnectAPI.OmniDesignerConnect.integrationProcedureExecute('Type_Subtype', apexInput);
        List<String> responseList = output.response;
        String currentSerResponse = responseList[0];
        Map<String, Object> currentResponseObj = (Map<String, Object>)JSON.deserializeUntyped(currentSerResponse);

        Object response = currentResponseObj.get('result');
        System.assertNotEquals(null, response);
    }
}   
```

Note these features of the example:

- You must use Salesforce's seeAllData property on the `@isTest` annotation. This ensures that the unit test sees the Omnistudio SObject data in the org.
- Use the `ConnectAPI.OmniDesignerConnect.integrationProcedureExecute()` Connect API to run the Integration Procedure.
- The `Type_Subtype` parameter specifies the Integration Procedure to test. Replace it with the Type and SubType of your Integration Procedure, separated by an underscore.

#### See Also

- [Integration Procedure Invocation from Apex](https://help.salesforce.com/s/articleView?id=xcloud.os_integration_procedure_invocation_from_apex_55724.htm&release=264.0.0&type=5 "Starting with Summer’ 25, use the ConnectAPI.OmniDesignerConnect.integrationProcedureExecute(ipName, apexInput) Connect API for Integration Procedure calls from the IntegrationProcedureService Apex class. This Connect API removes the dependency on the managed package and provides up to 21% better performance for Integration Procedure calls from an Apex class compared to the previous method.")