88 lines
3.8 KiB
OpenEdge ABL
88 lines
3.8 KiB
OpenEdge ABL
@isTest()
|
|
public with sharing class BatchForWebhooks_Test {
|
|
|
|
@isTest
|
|
public static void testBatchForWebhooks(){
|
|
|
|
/************************************************************************/
|
|
|
|
HIC_ShopifySync__Configuration__c hicConfigOb = new HIC_ShopifySync__Configuration__c();
|
|
hicConfigOb.Name='Default';
|
|
hicConfigOb.HIC_ShopifySync__Salesforce_Site_URL__c='https://www.google.com';
|
|
hicConfigOb.HIC_ShopifySync__Opportunity_Sync__c=true;
|
|
hicConfigOb.HIC_ShopifySync__Customer_Sync__c=true;
|
|
hicConfigOb.HIC_ShopifySync__Collection_Sync__c=true;
|
|
hicConfigOb.HIC_ShopifySync__Product_Sync__c=true;
|
|
hicConfigOb.HIC_ShopifySync__Order_Sync__c=true;
|
|
hicConfigOb.HIC_ShopifySync__Draft_Order_Sync__c=true;
|
|
hicConfigOb.HIC_ShopifySync__Inventory_Location_Sync__c=true;
|
|
hicConfigOb.HIC_ShopifySync__Order__c= true;
|
|
hicConfigOb.HIC_ShopifySync__Opportunity__c= true;
|
|
hicConfigOb.HIC_ShopifySync__Opportunity_Line_Item__c= true;
|
|
hicConfigOb.HIC_ShopifySync__Order_Fulfillment__c= true;
|
|
hicConfigOb.HIC_ShopifySync__Enable_Draft_Order__c=true;
|
|
hicConfigOb.HIC_ShopifySync__Account_Contact__c=true;
|
|
hicConfigOb.HIC_ShopifySync__Person_Account__c= true;
|
|
hicConfigOb.HIC_ShopifySync__Inventory_Location__c= true;
|
|
hicConfigOb.HIC_ShopifySync__Collection__c= true;
|
|
system.assertequals(true,hicConfigOb.HIC_ShopifySync__Collection__c);
|
|
insert hicConfigOb;
|
|
|
|
CustomSettingRecordInsert.InsertingConfiguration();
|
|
CustomSettingRecordInsert.InsertingWebhook();
|
|
}
|
|
|
|
@isTest
|
|
public static void testBatchForWebhooks1(){
|
|
|
|
/************************************************************************/
|
|
|
|
HIC_ShopifySync__Configuration__c hicConfigOb = new HIC_ShopifySync__Configuration__c();
|
|
hicConfigOb.Name='Default';
|
|
hicConfigOb.HIC_ShopifySync__Salesforce_Site_URL__c='https://www.google.com';
|
|
hicConfigOb.HIC_ShopifySync__Opportunity_Sync__c=true;
|
|
hicConfigOb.HIC_ShopifySync__Customer_Sync__c=true;
|
|
hicConfigOb.HIC_ShopifySync__Collection_Sync__c=true;
|
|
hicConfigOb.HIC_ShopifySync__Product_Sync__c=true;
|
|
hicConfigOb.HIC_ShopifySync__Order_Sync__c=true;
|
|
hicConfigOb.HIC_ShopifySync__Draft_Order_Sync__c=true;
|
|
hicConfigOb.HIC_ShopifySync__Inventory_Location_Sync__c=true;
|
|
hicConfigOb.HIC_ShopifySync__Order__c= true;
|
|
hicConfigOb.HIC_ShopifySync__Opportunity__c= true;
|
|
hicConfigOb.HIC_ShopifySync__Opportunity_Line_Item__c= true;
|
|
hicConfigOb.HIC_ShopifySync__Order_Fulfillment__c= true;
|
|
hicConfigOb.HIC_ShopifySync__Enable_Draft_Order__c=true;
|
|
hicConfigOb.HIC_ShopifySync__Account_Contact__c=true;
|
|
hicConfigOb.HIC_ShopifySync__Person_Account__c= true;
|
|
hicConfigOb.HIC_ShopifySync__Inventory_Location__c= true;
|
|
hicConfigOb.HIC_ShopifySync__Collection__c= true;
|
|
system.assertequals(true,hicConfigOb.HIC_ShopifySync__Collection__c);
|
|
insert hicConfigOb;
|
|
|
|
|
|
|
|
HIC_ShopifySync__Webhook__c wh = new HIC_ShopifySync__Webhook__c();
|
|
wh.Name = 'Order-Update';
|
|
wh.HIC_ShopifySync__SF_URL_Mapping__c = 'UpdateOrderFromShopifyAuthentication';
|
|
wh.HIC_ShopifySync__Topic__c = 'orders/updated';
|
|
wh.HIC_ShopifySync__Webhook_Id__c = '';
|
|
wh.HIC_ShopifySync__Shopify_Object__c = 'Order';
|
|
wh.HIC_ShopifySync__DML_Type__c = 'Update';
|
|
insert wh;
|
|
|
|
|
|
|
|
Test.startTest();
|
|
|
|
CustomSettingRecordInsert.InsertingConfiguration();
|
|
|
|
ScheduleBatchForWebhooks sobj = new ScheduleBatchForWebhooks();
|
|
sobj.execute(null);
|
|
|
|
|
|
Test.stopTest();
|
|
|
|
|
|
|
|
}
|
|
} |