@isTest private class OppSubmitControllerTest { @isTest static void testMethod1() { Profile p = [select id from Profile where id =:System.Label.ProfileId_SystemAdmin]; User u3 = new User(Test_staff__c = true); u3.LastName = '_サンブリッジ'; u3.Batch_User__c = true; u3.FirstName = 'う'; u3.Alias = 'う'; u3.Email = 'olympusTest03@sunbridge.com'; u3.Username = 'olympusTest03@sunbridge.com'; u3.CommunityNickname = 'う'; u3.IsActive = true; u3.EmailEncodingKey = 'ISO-2022-JP'; u3.TimeZoneSidKey = 'Asia/Tokyo'; u3.LocaleSidKey = 'ja_JP'; u3.LanguageLocaleKey = 'ja'; u3.ProfileId = p.id; u3.Job_Category__c = '支援'; insert u3; System.runAs(u3){ // 记录类型 RecordType recHanbaiten = [select id from RecordType where IsActive = true and SobjectType= 'Account' and Name='販売店' limit 1]; Account sellerA = new Account(Name = '販売店'); sellerA.RecordTypeId = recHanbaiten.id; sellerA.Ban_On_Use_Date__c = Date.today().addDays(20); insert sellerA; // 授权申请 Request_tedner_doc__c rtd = new Request_tedner_doc__c(); rtd.Request_target__c = u3.Id; rtd.Bid_distributor__c = sellerA.Id; rtd.Tender_No__c = '12345'; rtd.Tender_request_reason__c = 'reason'; rtd.Product_discription__c = 'aa'; insert rtd; OppSubmitController.initSubmitButton(rtd.Id); OppSubmitController.submit(rtd.Id); OppSubmitController.submitCancel(rtd.Id); OppSubmitController.submitCancel(rtd.Id+'1'); OppSubmitController.UserInfo_Owner(); } } // @IsTest // static void myTest1() { // List AccindoList = [Select Id, FROM Request_tedner_doc__c Where Assume_Change__c = true Limit 1]; // Test.StartTest(); // Database.executeBatch( new OppSubmitController(AccindoList),1); // Test.stopTest(); // } }