@isTest public with sharing class NFM624Rest2Test { static testMethod void testMethod1() { Test.startTest(); RestRequest req = new RestRequest(); RestResponse res = new RestResponse(); String JsonMsg = '{"Monitoring":{"MessageGroupNumber":"1668147552","Receiver":"SFDC","Text":"ONLINE","TransmissionDateTime":"1668147552","NumberOfRecord":"1668147552","Sender":"ONLINE","Tag":"ONLINE","MessageType":"NFM624"},"GeData":[{"UpsertContacts":[{"UnifiedIContactID":"1064598998507061248","Type":"*****","ServicePlatformCode":"","RegSource":"智慧医疗","PlatformDisabledRepresentation":false,"OwnerId":"00510000003MkTbAAK","MobilePhone":"***********","LastName":"***","Isactive":"有效","IgnoreSameName":true,"id":"0039D00000LY5n5QAD","FirstName":"","errorMsg":"","ContactAddress":"","AWSDataId":"1064594026553933825","ApproveDate":"2023-01-16","AgentFlag":false,"AccountId":"0019D00000S0H1LQAV"}],"UpsertAccounts":[{"StateText":null,"StateMaster":null,"RecordTypeId":null,"PlatformCode":"2626","ParentId":null,"OwnerId":null,"OCMCategory":null,"Name":null,"id":"0019D00000S0H1LQAV","HospitalSource":null,"Hospital":"0019D00000S0GiKQAV","DepartmentName":null,"DepartmentClass":null,"CityMaster":null}],"SFDCCodes":["8104136","8104146"],"rowDataId":null,"reCallNfm624RequestId":"1064598998020521984","NFM624SecondaryProcessing":true,"nfm624RequestId":"","Managements":["2625","2626"],"logstr":"0116Lu的新医院普外科0116Lu的新医院 普外科 普外科","isError":0,"ContactMap":{"2614":{"UnifiedIContactID":"1064542048599670784","Type":"*****","ServicePlatformCode":"","RegSource":"智慧医疗","PlatformDisabledRepresentation":false,"OwnerId":null,"MobilePhone":"***********","LastName":"***","Isactive":"有效","IgnoreSameName":true,"id":"0039D00000LVKS9QAP","FirstName":"","errorMsg":"","ContactAddress":"","AWSDataId":"1064541177216237569","ApproveDate":"2023-01-16","AgentFlag":false,"AccountId":null}},"ContactId":"1064598998507061248"}]}'; req.requestURI = 'services/apexrest/NFM624Rest2/execute'; req.httpMethod = 'POST'; req.requestBody = Blob.valueof(JsonMsg); RestContext.request = req; RestContext.response= res; NFM624Rest2.execute(); Test.stopTest(); } static testMethod void testMethod2() { Test.startTest(); NFM624Rest2.improveTestRate(); Test.stopTest(); } }