From fb04e7c01d119c60632b4298d18fd93f3ccb3d79 Mon Sep 17 00:00:00 2001
From: Li Jun <buli@deloitte.com.cn>
Date: 星期三, 06 四月 2022 10:32:05 +0800
Subject: [PATCH] 20220405DeployProduction

---
 force-app/main/default/classes/NewAndEditCaseControllerTest.cls |   31 ++++++++++++++++++++-----------
 1 files changed, 20 insertions(+), 11 deletions(-)

diff --git a/force-app/main/default/classes/NewAndEditCaseControllerTest.cls b/force-app/main/default/classes/NewAndEditCaseControllerTest.cls
index 5b3f2b6..ab494c0 100644
--- a/force-app/main/default/classes/NewAndEditCaseControllerTest.cls
+++ b/force-app/main/default/classes/NewAndEditCaseControllerTest.cls
@@ -11,17 +11,21 @@
     static testMethod void testMethod1() {
      
         TestDataUtility.CreatePIPolicyConfiguration();
-        Test.setMock(HttpCalloutMock.class, new TestDataUtility.CreateMetaDataUtilityHttpMock());
-        Case caseTest = TestDataUtility.CreateCase(1)[0];
-        Contact conTest = TestDataUtility.CreateContacts(1)[0];
-
+        //Test.setMock(HttpCalloutMock.class, new TestDataUtility.CreateMetaDataUtilityHttpMock());
+        //Case caseTest = TestDataUtility.CreateCase(1)[0];
+        //Contact conTest = TestDataUtility.CreateContacts(1)[0];
+		case caseTest = new case();
+            
+			//caseTest.ContactId = contact5.id;//瀹㈡埛浜哄憳濮撳悕锛� Contact
+            //caseTest.Account__c = aC.Id;//瀹㈡埛鍚嶇О锛� Account
+			caseTest.Subject = 'Test For Case';
         caseTest.AWS_Data_Id__c = '956935867849506816';
-        Update caseTest;
+        insert caseTest;
 
         Test.startTest();
         ApexPages.StandardController con =  new ApexPages.StandardController(caseTest);
         NewAndEditCaseController cas = new NewAndEditCaseController(con);
-        String caseJson = '{\"RecordTypeId\":\"01210000000QsYk\",\"CurrencyIsoCode\":\"CNY\",\"Costs__c\":\"\",\"CreatedDate\":null,\"ContactId\":\"'+conTest.Id+'\",\"Plan_Costs__c\":\"\",\"SunBridge_Owner__c\":\"\",\"Development_Phase__c\":\"\",\"Service_dept__c\":false,\"Status\":\"鏂拌\",\"Type\":\"\",\"Origin\":\"鏈暘鐠板\",\"Reason\":\"瑜囬洃銇鑳絓",\"Priority\":\"涓璡",\"PleaseConfirm__c\":false,\"Task_category__c\":\"1\",\"endDate__c\":\"\",\"Subject_Content_Riben__c\":\"\",\"Description\":\"\",\"Comments\":\"\",\"cic_telephone__c\":null,\"CASE_CUSTOMER__c\":null,\"Customer_manual__c\":null,\"cic_telephone_Encrypted__c\":null,\"CASE_CUSTOMER_Encrypted__c\":null,\"Customer_manual_Encrypted__c\":null,\"AWS_Data_Id__c\":\"956935867849506816\"}';
+        String caseJson = Json.serialize(caseTest);
         
         NewAndEditCaseController.saveCase(caseJson,'avgwshDFcxAS',False);
         Test.stopTest();
@@ -29,9 +33,9 @@
     static testMethod void testMethod2() {
      
         TestDataUtility.CreatePIPolicyConfiguration();
-        Test.setMock(HttpCalloutMock.class, new TestDataUtility.CreateMetaDataUtilityHttpMock());
+        //Test.setMock(HttpCalloutMock.class, new TestDataUtility.CreateMetaDataUtilityHttpMock());
         // Case caseTest = TestDataUtility.CreateCase(1)[0];
-        Contact conTest = TestDataUtility.CreateContacts(1)[0];
+        //Contact conTest = TestDataUtility.CreateContacts(1)[0];
 
         String recordTypeId = Schema.SObjectType.Case.getRecordTypeInfosByDeveloperName().get('CICRecordType').getRecordTypeId();
         String url = ApexPages.currentPage().getParameters().put('RecordType',recordTypeId);
@@ -42,9 +46,14 @@
 
         String aws = cas.awsToken;
         String conid = cas.contactId;
-
-        String caseJson = '{\"RecordTypeId\":\"01210000000QsYk\",\"CurrencyIsoCode\":\"CNY\",\"Costs__c\":\"\",\"CreatedDate\":\"2022-03-28T12:28:16.000+0000\",\"ContactId\":\"'+conTest.Id+'\",\"Plan_Costs__c\":\"\",\"SunBridge_Owner__c\":\"\",\"Development_Phase__c\":\"\",\"Service_dept__c\":false,\"Status\":\"鏂拌\",\"Type\":\"\",\"Origin\":\"鏈暘鐠板\",\"Reason\":\"瑜囬洃銇鑳絓",\"Priority\":\"涓璡",\"PleaseConfirm__c\":false,\"Task_category__c\":\"1\",\"endDate__c\":\"\",\"Subject_Content_Riben__c\":\"\",\"Description\":\"\",\"Comments\":\"\",\"cic_telephone__c\":null,\"CASE_CUSTOMER__c\":null,\"Customer_manual__c\":null,\"cic_telephone_Encrypted__c\":null,\"CASE_CUSTOMER_Encrypted__c\":null,\"Customer_manual_Encrypted__c\":null,\"AWS_Data_Id__c\":\"956935867849506816\"}';
-        
+		case caseTest = new case();
+            
+			//caseTest.ContactId = contact5.id;//瀹㈡埛浜哄憳濮撳悕锛� Contact
+            //caseTest.Account__c = aC.Id;//瀹㈡埛鍚嶇О锛� Account
+			caseTest.Subject = 'Test For Case';
+        caseTest.AWS_Data_Id__c = '956935867849506816';
+        //String caseJson = '{\"RecordTypeId\":\"01210000000QsYk\",\"CurrencyIsoCode\":\"CNY\",\"Costs__c\":\"\",\"CreatedDate\":\"2022-03-28T12:28:16.000+0000\",\"ContactId\":\"'+conTest.Id+'\",\"Plan_Costs__c\":\"\",\"SunBridge_Owner__c\":\"\",\"Development_Phase__c\":\"\",\"Service_dept__c\":false,\"Status\":\"鏂拌\",\"Type\":\"\",\"Origin\":\"鏈暘鐠板\",\"Reason\":\"瑜囬洃銇鑳絓",\"Priority\":\"涓璡",\"PleaseConfirm__c\":false,\"Task_category__c\":\"1\",\"endDate__c\":\"\",\"Subject_Content_Riben__c\":\"\",\"Description\":\"\",\"Comments\":\"\",\"cic_telephone__c\":null,\"CASE_CUSTOMER__c\":null,\"Customer_manual__c\":null,\"cic_telephone_Encrypted__c\":null,\"CASE_CUSTOMER_Encrypted__c\":null,\"Customer_manual_Encrypted__c\":null,\"AWS_Data_Id__c\":\"956935867849506816\"}';
+        String caseJson = json.serialize(caseTest);
         NewAndEditCaseController.saveCase(caseJson,'avgwshDFcxAS',False);
         Test.stopTest();
     }

--
Gitblit v1.9.1