From 5835379ec30b1667c4e522db9d294c9b7bb8633a Mon Sep 17 00:00:00 2001
From: buli <137736985@qq.com>
Date: 星期二, 26 四月 2022 12:00:31 +0800
Subject: [PATCH] SSBG Back up
---
force-app/main/default/classes/NewAndEditUserFaultInfoControllerTest.cls | 64 ++++++++++++++++++++++++++++++-
1 files changed, 61 insertions(+), 3 deletions(-)
diff --git a/force-app/main/default/classes/NewAndEditUserFaultInfoControllerTest.cls b/force-app/main/default/classes/NewAndEditUserFaultInfoControllerTest.cls
index 0657dc7..a92e2f5 100644
--- a/force-app/main/default/classes/NewAndEditUserFaultInfoControllerTest.cls
+++ b/force-app/main/default/classes/NewAndEditUserFaultInfoControllerTest.cls
@@ -4,16 +4,74 @@
static void makeData(){
TestDataUtility.CreatePIPolicyConfiguration();
}
- static testMethod void NewAndEditLoanerApplicationController() {
+ static testMethod void NewAndEditLoanerApplicationController1() {
+ Contact ccn = TestDataUtility.CreateContacts(1)[0];
+ ccn.AWS_Data_Id__c = 'a0m0l000002XnpsAAC';
+ update ccn;
Test.setMock(HttpCalloutMock.class, new TestDataUtility.CreateMetaDataUtilityHttpMock());
loaner_application__c la = TestDataUtility.Createloanerapplications(1)[0];
+ //User_FaultInfo__c UF = new User_FaultInfo__c();
+ User_FaultInfo__c ca = new User_FaultInfo__c();
+ ca.ORIGIN__c = 'Web';
+ ca.SUBJECT__c = 'test';
+ ca.OFFICE_OWNER__c = 'Beijing';
+ ca.Product_Type__c = 'NDT';
+ ca.TYPE__c = 'Service';
+ ca.LOGISTICS_SHIPMENT_TYPE__c = 'Domestic';
+ ca.STATUS__c = 'Not Started';
+ ca.PRIORITY__c = 'High';
+ insert ca;
+ ca.COMPANY__c = ccn.AccountId;
+ ca.CONTACT__c = ccn.Id;
+ ca.UFContact__c = ccn.Id;
+ update ca;
+
Test.startTest();
- ApexPages.StandardController con = new ApexPages.StandardController(la);
+ ApexPages.StandardController con = new ApexPages.StandardController(ca);
NewAndEditUserFaultInfoController qis = new NewAndEditUserFaultInfoController(con);
+ qis.PIPL_Input_Account_Error_Msg = 'error';
+ qis.staticResourceContact = 'contact';
+ qis.contactId = '111';
- String qisJson = '{"Name":"test123","QIS_Status__c":"鑽夋涓�","QIS_pre__c":"000000000000000","consumable__c":"01t1m000001QyDa","Cancel_QIS_Reason__c":"_u0001_","RecordTypeId":"01210000000RLWc","Repair__c":"a0J1m000001nZzf","RejectReason__c":"","Managementtext__c":"","OCSMAdministrativeReportStatus__c":"鏃犻渶鎶ュ憡","MBC_AwareDate__c":"2022/03/29","Aware_date__c":"2022/03/29","Old_Repair_Name__c":"","isLendRental__c":false,"next_action__c":"","RC_problem_not_found__c":false,"Salesdepartment_Text__c":"","OCM_Repair_Mail1__c":"","Hospital__c":"0011m00000XlvHh","Account_State__c":"","Department_Class__c":"0011m00000SP4Mp","OwnerId":"0051m0000030e0QAAQ","Hospital_Department__c":"0011m00000SP4TB","Responsible_Person_HP__c":"***","Caller_phone__c":"***********","capital_or_consumable__c":"鑰楁潗","contract_number_ET_text__c":"","nonyushohin__c":"000000000000000","InstallDate_text__c":"","usage_frequence__c":"1","cleanning__c":"1","cds_methods__c":"鎵嬪姩","disinfection__c":"","sterlization__c":"","Faliour_date__c":"2022/03/29","Trable_occur_daY_collect__c":"2022/03/29","DelayReportReason__c":"","failuer_situation__c":"鍒拌揣楠屾敹","failuer_situationSelect__c":"","problem_detail__c":"test","Damage_For_Doc_Or_Pat__c":"","Relation_With_The_Problem__c":"","Report_For_Goz__c":"","Which_Project__c":"","Opera_Name__c":"","BreakORFallOff__c":"","Is_Used_For_The_Opera__c":"","Set_usage_product__c":"","Comment__c":"test","AfterFailureInformation__c":"","Delay15Min__c":"","InformationFrom__c":"","FailureQInHospital__c":"","accsessary_detail__c":"","shipping_to_QIS_dept_day__c":"","ASReportedCode__c":"","QIS_ConfirmationDate__c":"","PAE_Determine__c":"","ASReportedCodeAC__c":"","OCSM_RC_CordingDate__c":"","PAE_DetermineAC__c":"","Complaint_Number__c":"","OSH_ConfirmationDate__c":"","if_QIS_Allowed__c":"","NotAllowedReason__c":"","OSHRAConfirmDate__c":"","isAE_Profile__c":"","isPAE_Profile__c":"","MDR_information__c":"","MDR_detail__c":"","CFDA_No_Hand__c":"","ProduceCompany_hand__c":"","Receive_Date_Day__c":"2022/03/29","OSHRecievedDate__c":"","QIS_Submit_day__c":"","QIS_OSH_answerdate__c":"","OCM_RC_RecievedDate__c":"","QIS_Complete_Day__c":"","QIS_Reply_day__c":"","QIS_cancel_date__c":"","QIS_Cancel_Submit_day__c":"","Daily_Report__c":"000000000000000","Generation_Source__c":"","Source_OnCall__c":"000000000000000","QisSubOrder__c":"000000000000000","AsyncData__c":false,"ETQ_UPLOAD_STATUS__c":"","AWS_Interface_Time__c":"2022/03/29 13:38","ETQ_UPLOAD_MESSAGE__c":"","INTERFACE_RECORD_ID__c":"","ET_QIS_SEND_EMAIL1__c":"","ET_QIS_SEND_EMAIL2__c":"","problem_detail_photo__c":"","Caller_phone_Encrypted__c":"415f2dab7eb6b2a866e02d823080a845","Responsible_Person_HP_Encrypted__c":"dcce196c4cfc273a83777852ddd486ab","AWS_Data_Id__c":"958360820671053825"}';
+
+ String qisJson = '{"Name":"23432432","ORIGIN__c":"E-mail","SUBJECT__c":"fdsafads","OFFICE_OWNER__c":"Beijing","INCIDENT_DATE__c":"","SYSTEM_TYPE__c":"","INBOUND_EMAIL_ADDRESS__c":"","TRAN__c":"","ZONE__c":"","Product_Type__c":"","TYPE__c":"Question","UFPhone__c":"***********","PAYMENT_TERM__c":"","ASSIGNED_TO__c":"00528000000YVZE","SUBSIDIARY__c":"","CONTACT__c":"0030l00000mqqfiAAA","COMPANY__c":"0010l00001QAz54","LOGISTICS_SHIPMENT_TYPE__c":"Domestic","VISUAL_WORK_ORDER_NUMBER__c":"","LAST_MESSAGE_DATETIME__c":"","STATUS__c":"In Progress","BID_TOTAL__c":"","PRIORITY__c":"Medium","SERIAL_NUMBER_NOT_MANDATORY__c":"","SEND_TO_CUSTOMER__c":false,"INTERNAL_ONLY__c":true,"Interactions__c":"","interactionsHistory__c":"","UFPhone_Encrypted__c":"af6b1eac5a3196e7918745a50b42cc04","INBOUND_EMAIL_ADDRESS_Encrypted__c":"","AWS_Data_Id__c":"963391015715078145"}';
NewAndEditUserFaultInfoController.saveUserFaultInfo(qisJson,'avgwshDFcxAS',False);
+ Test.stopTest();
+ }
+
+ static testMethod void NewAndEditLoanerApplicationController2() {
+ Contact ccn = TestDataUtility.CreateContacts(1)[0];
+ ccn.AWS_Data_Id__c = 'a0m0l000002XnpsAAC';
+ update ccn;
+ Test.setMock(HttpCalloutMock.class, new TestDataUtility.CreateMetaDataUtilityHttpMock());
+ loaner_application__c la = TestDataUtility.Createloanerapplications(1)[0];
+ //User_FaultInfo__c UF = new User_FaultInfo__c();
+ User_FaultInfo__c ca = new User_FaultInfo__c();
+ ca.ORIGIN__c = 'Web';
+ ca.SUBJECT__c = 'test';
+ ca.OFFICE_OWNER__c = 'Beijing';
+ ca.Product_Type__c = 'NDT';
+ ca.TYPE__c = 'Service';
+ ca.LOGISTICS_SHIPMENT_TYPE__c = 'Domestic';
+ ca.STATUS__c = 'Not Started';
+ ca.PRIORITY__c = 'High';
+ insert ca;
+ ca.COMPANY__c = ccn.AccountId;
+ // ca.CONTACT__c = ccn.Id;
+ update ca;
+
+
+ Test.startTest();
+ ApexPages.StandardController con = new ApexPages.StandardController(ca);
+ NewAndEditUserFaultInfoController qis = new NewAndEditUserFaultInfoController(con);
+ qis.PIPL_Input_Account_Error_Msg = 'error';
+ qis.staticResourceContact = 'contact';
+ qis.contactId = '111';
+
+
+ String qisJson = '{"Name":"23432432","ORIGIN__c":"E-mail","SUBJECT__c":"fdsafads","OFFICE_OWNER__c":"Beijing","INCIDENT_DATE__c":"","SYSTEM_TYPE__c":"","INBOUND_EMAIL_ADDRESS__c":"","TRAN__c":"","ZONE__c":"","Product_Type__c":"","TYPE__c":"Question","UFPhone__c":"***********","PAYMENT_TERM__c":"","ASSIGNED_TO__c":"00528000000YVZE","SUBSIDIARY__c":"","CONTACT__c":"0030l00000mqqfiAAA","COMPANY__c":"0010l00001QAz54","LOGISTICS_SHIPMENT_TYPE__c":"Domestic","VISUAL_WORK_ORDER_NUMBER__c":"","LAST_MESSAGE_DATETIME__c":"","STATUS__c":"In Progress","BID_TOTAL__c":"","PRIORITY__c":"Medium","SERIAL_NUMBER_NOT_MANDATORY__c":"","SEND_TO_CUSTOMER__c":false,"INTERNAL_ONLY__c":true,"Interactions__c":"","interactionsHistory__c":"","UFPhone_Encrypted__c":"af6b1eac5a3196e7918745a50b42cc04","INBOUND_EMAIL_ADDRESS_Encrypted__c":"","AWS_Data_Id__c":"963391015715078145"}';
+
NewAndEditUserFaultInfoController.saveUserFaultInfo(qisJson,'avgwshDFcxAS',True);
Test.stopTest();
}
--
Gitblit v1.9.1