@isTest public class NFM621ControllerBatchTest { static testMethod void testMethod1() { Profile p = [select Id from Profile where id =: System.Label.ProfileId_SystemAdmin]; User u1 = new User(Test_staff__c = true); u1.LastName = '_サンブリッジ'; u1.FirstName = 'あ'; u1.Alias = 'あ'; u1.Email = 'olympusTest01@sunbridge.com'; u1.Username = 'olympusTest01@sunbridge.com'; u1.CommunityNickname = 'あ'; u1.IsActive = true; u1.EmailEncodingKey = 'ISO-2022-JP'; u1.TimeZoneSidKey = 'Asia/Tokyo'; u1.LocaleSidKey = 'ja_JP'; u1.LanguageLocaleKey = 'ja'; u1.ProfileId = p.Id; u1.Job_Category__c = '销售服务'; u1.Province__c = '東京'; u1.Stay_or_not__c = '在职'; u1.QuitDate__c = Date.today().addDays(-1); u1.SendToComPlat__c = false; System.runAs(new User(Id = Userinfo.getUserId())) { System.Test.startTest(); insert u1; Database.executeBatch(new NFM621ControllerBatch(), 100); //List us = [select Id,SendToComPlat__c from User where Id =: u1.Id]; //System.assertEquals(true, us[0].SendToComPlat__c); System.Test.stopTest(); } } }