@isTest
public with sharing class RetrospectiveWeeklyReportTest {
        public static Account account1 = new Account();
        public static Account account2 = new Account();
        public static Contact contact1 = new Contact();
        public static Contact contact2 = new Contact();
        public static Product2 pro1 = new Product2();
        public static Product2 pro2 = new Product2();
        public static Product2 pro3 = new Product2();
        public static FieldClassification__c fc1 = new FieldClassification__c();
        public static FieldClassification__c fc2 = new FieldClassification__c();
        public static FieldClassification__c fc3  = new FieldClassification__c();
        public static FieldClassification__c fc4  = new FieldClassification__c();
        public static User user = new User();
        public static Agency_Hospital_Link__c agency_hospital_link = new Agency_Hospital_Link__c();
        public static Agency_Contact__c agency_contact = new Agency_Contact__c();
        // 经销商活动周报导入 update by vivek end     
        public static OlympusCalendar__c olympus_calendar = new OlympusCalendar__c();
        
        // // public static productCategories__c pca = new productCategories__c();
        // public static WarlockClassification__c wcf = new WarlockClassification__c();
        // public static EffectProgress__c etp = new EffectProgress__c();
        
        public static String report_id;
        public static String report_header_id;
        
        /* 病院。コンタクト、ユーザー、カレンダーなどの初期データ作る
        */
        private static void testInit() {
            // 取引先
            account1.Name = 'test1医院';
            account1.RecordTypeId = '01210000000QemG';
            insert account1;
            
            account2.Name = 'test1经销商';
            account2.RecordTypeId = '01210000000Qem1';
            insert account2;
            
            // 取引先責任者
            contact1.AccountId = account1.Id;
            contact1.FirstName = '責任者';
            contact1.LastName = 'test1医院';
            insert contact1;
            
            contact2.AccountId = account2.Id;
            contact2.FirstName = '責任者';
            contact2.LastName = 'test1经销商';
            insert contact2;
    
            Profile p = [select Id from Profile where Name = '901_经销商活动系统'];
            user.ProfileId = p.Id;
            user.UserPro_Type__c = 'ET';
            user.ContactId = contact2.Id;
            user.FirstName = 'ユーザー';
            user.LastName = 'テスト';
            user.Email = 'test_user@example.com';
            user.emailencodingkey='UTF-8';
            user.languagelocalekey='zh_CN';
            user.localesidkey='ja_JP';
            user.timezonesidkey='Asia/Shanghai';
            user.Username = 'test_user@example.com';
            user.Alias = 'テユ';
            user.CommunityNickname = 'テストユーザー';
            insert user;
            
            // 代理店医院
            agency_hospital_link.Name = 'test1代理店医院';
            agency_hospital_link.Hospital__c = account1.Id;
            agency_hospital_link.Agency__c = account2.Id;
            agency_hospital_link.OwnerId = user.Id;
            agency_hospital_link.Agency_Campaign_Obj__c = true;
            insert agency_hospital_link;
            
            // 先生
            agency_contact.Name = 'test1医院先生';
            agency_contact.Doctor_Division1__c = '院长';
            agency_contact.Type__c = '医生';
            agency_contact.Agency_Hospital__c = agency_hospital_link.Id;
            agency_contact.OwnerId = user.Id;
            insert agency_contact;

            
            pro1.Name='name01';
            pro1.IsActive=true;
            pro1.Family='GI';
            pro1.Fixture_Model_No__c='n01';
            pro1.Serial_Lot_No__c='S/N tracing';
            pro1.Category3__c = 'ERCP';
            pro1.Fixture_Model_No_T__c = 'n01';
            pro1.ProductCode_Ext__c='pc01';
            pro1.Manual_Entry__c=false;
            insert pro1;

            pro2.Name='name02';
            pro2.IsActive=true;
            pro2.Family='GI';
            pro2.Fixture_Model_No__c='n01';
            pro2.Serial_Lot_No__c='S/N tracing';
            pro2.Category3__c = 'ERCP';
            pro2.Fixture_Model_No_T__c = 'n01';
            pro2.ProductCode_Ext__c='pc01';
            pro2.Manual_Entry__c=false;
            insert pro2;

            pro3.Name='name03';
            pro3.IsActive=true;
            pro3.Family='GI';
            pro3.Fixture_Model_No__c='n01';
            pro3.Serial_Lot_No__c='S/N tracing';
            pro3.Category3__c = 'ERCP';
            pro3.Fixture_Model_No_T__c = 'n01';
            pro3.ProductCode_Ext__c='pc01';
            pro3.Manual_Entry__c=false;
            insert pro3;
            // オリンパスカレンダー
            olympus_calendar.Date__c = Date.valueOf('2022-02-28');
            olympus_calendar.OwnerId = user.Id;
            insert olympus_calendar;
            
            fc1.Name = '1';
            fc1.ProductCcategory__c = '安瑞';
            fc1.classification__c = 'ET';
            insert fc1;
            fc2.Name = '2';
            fc2.WarlockClassification__c = '取石气囊';
            fc2.ProductClassification__c = 'ERCP';
            insert fc2;

            fc3.Name = '3';
            fc3.EffectProgress__c = '院级审核';
            fc3.WorkRecord__c = '院内入院申请';
            insert fc3;

            fc4.Name = '4';
            fc4.productCategories__c = '无线超声切割刀';
            fc4.ET_ENG_classification__c = 'ENG';
            fc4.ProductCcategory__c = '安瑞';
            insert fc4;
        }
        // @isTest public static void getProductListTest() {
        //     testInit();
        //     String select_ProductCcategory = pc.Id;
            
        //     System.runAs(user) {
        //         // 病院リスト取得
        //         List<Map<String,String>> test = RetrospectiveWeeklyReportController.selectProductCcategory01(select_ProductCcategory);
        //         Map<String,String> test_data = new Map<String,String>();
        //         test_data.put('label', agency_contact.Name);
        //         test_data.put('value', agency_contact.Id);
        //         System.assertEquals(test_data,null);
        //     }
        // }
        @isTest public static void selectProductCcategoryTest() {
            testInit();
            String select_ProductCcategory = fc1.ProductCcategory__c;
            
            System.runAs(user) {
                // 病院リスト取得
                List<Map<String,String>> test = RetrospectiveWeeklyReportController.selectProductCcategory();
                System.assertNotEquals(test, null);
            }
        }
        @isTest public static void getalldataTest() {
            testInit();
            
            System.runAs(user) {
                // 病院リスト取得
                RetrospectiveWeeklyReportController test = RetrospectiveWeeklyReportController.getalldata();
                System.assertNotEquals(test, null);
            }
        }
        @isTest
        public static void createReportHeaderTest() {
            testInit();
            
            System.runAs(user) {
                // 週報ヘッダー作成
                String name = 'テスト ユーザー';
                String s_date = '2022-02-28';
                String s_agency = contact2.Id;
                String head_key = contact2.Id + ':20220228';
                report_header_id = RetrospectiveWeeklyReportController.createReportHeader(name, s_date, s_agency, head_key);
                
                Agency_Report_Header__c data = [select Id, Name, Week__c, Agency_Person2__c, HeaderInputKey__c, OlympusDate__r.Date__c from Agency_Report_Header__c where HeaderInputKey__c = :head_key];
                System.assertEquals(name + ' (' + s_date + ')', data.Name);
                System.assertEquals(Date.valueOf(s_date), data.Week__c);
                System.assertEquals(s_agency, data.Agency_Person2__c);
                System.assertEquals(head_key, data.HeaderInputKey__c);
                System.assertEquals(Date.valueOf(s_date), data.OlympusDate__r.Date__c);
            }
        }
        @isTest public static void getDoctorListTest() {
            testInit();
            
            System.runAs(user) {
                List<Map<String,String>> doctor_data = RetrospectiveWeeklyReportController.getDoctorList(agency_hospital_link.Id);
                Map<String,String> test_data = new Map<String,String>();
                test_data.put('label', agency_contact.Name);
                test_data.put('value', agency_contact.Id);
                test_data.put('selected', 'false');
                test_data.put('Doctor_Division1__c', agency_contact.Doctor_Division1__c);
                System.assertEquals(test_data, doctor_data[1]);
            }
        }  
        @isTest public static void selectProductClassificationc() {
            testInit();
            String str = 'ERCP';
            System.runAs(user) {
                List<Map<String,String>> doctor_data = RetrospectiveWeeklyReportController.selectProductClassificationc(str);
                Map<String,String> test_data = new Map<String,String>();
                test_data.put('label', fc2.WarlockClassification__c);
                test_data.put('value', fc2.Id);
                System.assertEquals(test_data, doctor_data[1]);
            }
        }
        @isTest public static void selectPurposeTypes() {
            testInit();
            String str ='院内入院申请';
            System.runAs(user) {
                List<Map<String,String>> doctor_data = RetrospectiveWeeklyReportController.selectPurposeTypes(str);
                Map<String,String> test_data = new Map<String,String>();
                test_data.put('label', fc3.EffectProgress__c);
                test_data.put('value', fc3.Id);
                System.assertEquals(test_data, doctor_data[1]);
            }
        }
        @isTest public static void processData() {
            
            testInit();
            OlympusCalendar__c oc1 = new OlympusCalendar__c();
            oc1.Date__c = Date.valueOf('2022-3-1');
            insert oc1;
            OlympusCalendar__c oc2 = new OlympusCalendar__c();
            oc2.Date__c = Date.valueOf('2022-3-2');
            insert oc2;
            OlympusCalendar__c oc3 = new OlympusCalendar__c();
            oc3.Date__c = Date.valueOf('2022-2-28');
            insert oc3;
            Test.startTest();
            System.runAs(user) {
            String reports = RetrospectiveWeeklyReportController.processData('"周,担当,活动日,医院,科室,经销商人员,工作记录,医院人员,产品分类(第三分类),使用产品1(产品型号),使用产品2,使用产品3,效果/进度,科室同类耗材月使用量,术士分类,已采用其他品牌,产品用量,工作标记\r\n2022-02-28,姜 彦,2022-03-03,鞍山九洲医院,ET,姜 彦,院内入院申请,小付,ERCP,KD-6G17Q-1-A:停止2005/10 G型导丝乳头切开刀,KD-200Q-0730:乳头切开刀,KD-211Q-0720:高频切开刀,院级审核,11,取石气囊,美迪云,,22,false\r\n2022-02-28,姜 彦,2022-03-03,鞍山九洲医院,ET,姜 彦,院内入院申请,小付,ERCP,KD-6G17Q-1-A:停止2005/10 G型导丝乳头切开刀,KD-200Q-0730:乳头切开刀,KD-211Q-0720:高频切开刀,院级审核,11,取石气囊,美迪云,,22,false\r\n','',null);
            }
            Test.stopTest();
        }
        @isTest static void saveAgencyReportTest() {
            testInit();
            
            System.runAs(user) {
                String name = 'テスト ユーザー';
                String s_date = '2022-02-28';
                String s_agency = contact2.Id;
                String head_key = contact2.Id + ':20220228';
                report_header_id = RetrospectiveWeeklyReportController.createReportHeader(name, s_date, s_agency, head_key);
                
                // 週報作成 String
                String Department_Cateogy = '';
                Decimal ConsumptionOfConsumables = 0;
                Boolean WorkMark  = false;
                Decimal warlocksNumber = 0;
                String DealerPersonnel = '';
                String ProductCcategory = '';
                String productCategories = '';
                String WarlockClassification = '';
                String ProductClassification = '';
                String WorkRecord = '';
                String EffectProgress = '';
                String Agency_Report_Header = '';
                String Agency_Hospital = '';
                String Person_In_Charge2 = '';
                String doctor = '';
                String Submit_date = '';
                String UseProduct1 = '';
                String UseProduct2 = '';
                String UseProduct3 = '';
                String StageName = '';
                String oppAmount = '';
                String oppOCMPrice = '';
                String Close_Forecasted_Date = '';
                String Report_Date = '';
                Department_Cateogy = 'ET';
                ConsumptionOfConsumables = 11;
                WorkMark  = true;
                warlocksNumber = 22;
                DealerPersonnel = contact1.id;
                ProductCcategory = fc1.ID;
                productCategories = '';
                WarlockClassification = fc2.ID;
                ProductClassification = 'ERCP';
                WorkRecord = '院内入院申请';
                EffectProgress = fc3.ID;
                Agency_Report_Header = report_header_id;
                Agency_Hospital = agency_hospital_link.Id;
                Person_In_Charge2 = contact2.Id;
                doctor = agency_contact.Id;
                Submit_date = '2022-02-28';
                UseProduct1 = pro1.id;
                UseProduct2 = pro2.Id;
                UseProduct3 = pro3.id;
                StageName = '';
                oppAmount = '';
                oppOCMPrice = '';
                Close_Forecasted_Date = '';
                Report_Date = '2022-3-3';
                report_id = RetrospectiveWeeklyReportController.saveAgencyReport(Department_Cateogy,ConsumptionOfConsumables,
                            WorkMark,warlocksNumber,DealerPersonnel,ProductCcategory,productCategories,WarlockClassification,ProductClassification, WorkRecord,
                            EffectProgress,Agency_Report_Header,
                            Agency_Hospital, Person_In_Charge2, doctor, Submit_date,
                            UseProduct1, UseProduct2, UseProduct3,
                            StageName, oppAmount, oppOCMPrice, Close_Forecasted_Date, Report_Date);
                
                Agency_Report__c data = [select Id, Name, Department_Cateogy__c, ConsumptionOfConsumables__c, WorkRecord__c,EffectProgress__c,WarlockClassification__c,
                ProductCcategory__c, productCategories__c,warlocksNumber__c,WorkMark__c,ProductClassification__c,DealerPersonnel__c, Agency_Report_Header__c,Agency_Hospital__c,UseProduct1__c,
                UseProduct2__c, UseProduct3__c,  Person_In_Charge2__c,doctor2__c,Submit_date__c,Report_Date__c
                from Agency_Report__c where id=:report_id];

                System.assertEquals(Department_Cateogy, data.Department_Cateogy__c);
                System.assertEquals(Agency_Report_Header, data.Agency_Report_Header__c);
                System.assertEquals(Agency_Hospital, data.Agency_Hospital__c);
                System.assertEquals(Person_In_Charge2, data.Person_In_Charge2__c);
                System.assertEquals(doctor, data.doctor2__c);
                System.assertEquals(Date.valueOf(Submit_date), data.Submit_date__c);
            }
        }
        @isTest public static void editAgencyReportTest() {
            saveAgencyReportTest();
            
            System.runAs(user) {
                String Department_Cateogy = '';
                Decimal ConsumptionOfConsumables = 0;
                Boolean WorkMark  = false;
                Decimal warlocksNumber = 0;
                String DealerPersonnel = '';
                String ProductCcategory = '';
                String productCategories = '';
                String WarlockClassification = '';
                String ProductClassification = '';
                String WorkRecord = '';
                String EffectProgress = '';
                String Agency_Report_Header = '';
                String Agency_Hospital = '';
                String Person_In_Charge2 = '';
                String doctor = '';
                String Submit_date = '';
                String UseProduct1 = '';
                String UseProduct2 = '';
                String UseProduct3 = '';
                String StageName = '';
                String oppAmount = '';
                String oppOCMPrice = '';
                String Close_Forecasted_Date = '';
                String Report_Date = '';
                Department_Cateogy = 'ET';
                ConsumptionOfConsumables = 11;
                WorkMark  = true;
                warlocksNumber = 22;
                DealerPersonnel = contact1.id;
                ProductCcategory = fc1.ID;
                productCategories = '';
                WarlockClassification = fc2.ID;
                ProductClassification = 'ERCP';
                WorkRecord = '院内入院申请';
                EffectProgress = fc3.Id;
                Agency_Report_Header = report_header_id;
                Agency_Hospital = agency_hospital_link.Id;
                Person_In_Charge2 = contact2.Id;
                doctor = agency_contact.Id;
                Submit_date = '2022-02-28';
                UseProduct1 = pro1.id;
                UseProduct2 = pro2.Id;
                UseProduct3 = pro3.id;
                Report_Date = '2022-3-3';
                Test.startTest();
                // 週報編集  
                Department_Cateogy = 'BF';
                report_id = RetrospectiveWeeklyReportController.editAgencyReport(report_id,Department_Cateogy,ConsumptionOfConsumables,
                                                            WorkMark,warlocksNumber,DealerPersonnel,WarlockClassification,ProductCcategory,productCategories,ProductClassification, 
                                                            EffectProgress,WorkRecord,Agency_Report_Header,
                                                            Agency_Hospital, Person_In_Charge2, doctor, Submit_date,
                                                            UseProduct1, UseProduct2, UseProduct3,
                                                            Report_Date);
                Agency_Report__c data = [select Id, Name, Department_Cateogy__c, ConsumptionOfConsumables__c, WorkRecord__c,EffectProgress__c,WarlockClassification__c,
                                            ProductCcategory__c, productCategories__c,warlocksNumber__c,WorkMark__c,ProductClassification__c,DealerPersonnel__c, Agency_Report_Header__c,Agency_Hospital__c,UseProduct1__c,
                                            UseProduct2__c, UseProduct3__c,  Person_In_Charge2__c,doctor2__c,Submit_date__c,Report_Date__c
                                            from Agency_Report__c where id=:report_id];
                System.assertEquals(Department_Cateogy, data.Department_Cateogy__c);
                
                Department_Cateogy = 'GYN';
                report_id = RetrospectiveWeeklyReportController.editAgencyReport(report_id,Department_Cateogy,ConsumptionOfConsumables,
                                                            WorkMark,warlocksNumber,DealerPersonnel,WarlockClassification,ProductCcategory,productCategories,ProductClassification, 
                                                            EffectProgress,WorkRecord,Agency_Report_Header,
                                                            Agency_Hospital, Person_In_Charge2, doctor, Submit_date,
                                                            UseProduct1, UseProduct2, UseProduct3,
                                                            Report_Date);
                data = [select Id, Name, Department_Cateogy__c, ConsumptionOfConsumables__c, WorkRecord__c,EffectProgress__c,WarlockClassification__c,
                            ProductCcategory__c, productCategories__c,warlocksNumber__c,WorkMark__c,ProductClassification__c,DealerPersonnel__c, Agency_Report_Header__c,Agency_Hospital__c,UseProduct1__c,
                            UseProduct2__c, UseProduct3__c,  Person_In_Charge2__c,doctor2__c,Submit_date__c,Report_Date__c
                            from Agency_Report__c where id=:report_id];
                System.assertEquals(Department_Cateogy, data.Department_Cateogy__c);
    
                Department_Cateogy = 'GS';
                report_id = RetrospectiveWeeklyReportController.editAgencyReport(report_id,Department_Cateogy,ConsumptionOfConsumables,
                                                            WorkMark,warlocksNumber,DealerPersonnel,WarlockClassification,ProductCcategory,productCategories,ProductClassification, 
                                                            EffectProgress,WorkRecord,Agency_Report_Header,
                                                            Agency_Hospital, Person_In_Charge2, doctor, Submit_date,
                                                            UseProduct1, UseProduct2, UseProduct3,
                                                            Report_Date);
                data = [select Id, Name, Department_Cateogy__c, ConsumptionOfConsumables__c, WorkRecord__c,EffectProgress__c,WarlockClassification__c,
                                            ProductCcategory__c, productCategories__c,warlocksNumber__c,WorkMark__c,ProductClassification__c,DealerPersonnel__c, Agency_Report_Header__c,Agency_Hospital__c,UseProduct1__c,
                                            UseProduct2__c, UseProduct3__c,  Person_In_Charge2__c,doctor2__c,Submit_date__c,Report_Date__c
                                            from Agency_Report__c where id=:report_id];
                System.assertEquals(Department_Cateogy, data.Department_Cateogy__c);
    
                Department_Cateogy = 'URO';
                report_id = RetrospectiveWeeklyReportController.editAgencyReport(report_id,Department_Cateogy,ConsumptionOfConsumables,
                                                            WorkMark,warlocksNumber,DealerPersonnel,WarlockClassification,ProductCcategory,productCategories,ProductClassification, 
                                                            EffectProgress,WorkRecord,Agency_Report_Header,
                                                            Agency_Hospital, Person_In_Charge2, doctor, Submit_date,
                                                            UseProduct1, UseProduct2, UseProduct3,
                                                            Report_Date);
                data = [select Id, Name, Department_Cateogy__c, ConsumptionOfConsumables__c, WorkRecord__c,EffectProgress__c,WarlockClassification__c,
                            ProductCcategory__c, productCategories__c,warlocksNumber__c,WorkMark__c,ProductClassification__c,DealerPersonnel__c, Agency_Report_Header__c,Agency_Hospital__c,UseProduct1__c,
                            UseProduct2__c, UseProduct3__c,  Person_In_Charge2__c,doctor2__c,Submit_date__c,Report_Date__c
                            from Agency_Report__c where id=:report_id];
                System.assertEquals(Department_Cateogy, data.Department_Cateogy__c);
    
                Department_Cateogy = 'ENT';
                report_id = RetrospectiveWeeklyReportController.editAgencyReport(report_id,Department_Cateogy,ConsumptionOfConsumables,
                                                            WorkMark,warlocksNumber,DealerPersonnel,WarlockClassification,ProductCcategory,productCategories,ProductClassification, 
                                                            EffectProgress,WorkRecord,Agency_Report_Header,
                                                            Agency_Hospital, Person_In_Charge2, doctor, Submit_date,
                                                            UseProduct1, UseProduct2, UseProduct3,
                                                            Report_Date);
                data = [select Id, Name, Department_Cateogy__c, ConsumptionOfConsumables__c, WorkRecord__c,EffectProgress__c,WarlockClassification__c,
                                    ProductCcategory__c, productCategories__c,warlocksNumber__c,WorkMark__c,ProductClassification__c,DealerPersonnel__c, Agency_Report_Header__c,Agency_Hospital__c,UseProduct1__c,
                                    UseProduct2__c, UseProduct3__c,  Person_In_Charge2__c,doctor2__c,Submit_date__c,Report_Date__c
                                    from Agency_Report__c where id=:report_id];
                System.assertEquals(Department_Cateogy, data.Department_Cateogy__c);
    
                Department_Cateogy = 'ET';
                report_id = RetrospectiveWeeklyReportController.editAgencyReport(report_id,Department_Cateogy,ConsumptionOfConsumables,
                                                            WorkMark,warlocksNumber,DealerPersonnel,WarlockClassification,ProductCcategory,productCategories,ProductClassification, 
                                                            EffectProgress,WorkRecord,Agency_Report_Header,
                                                            Agency_Hospital, Person_In_Charge2, doctor, Submit_date,
                                                            UseProduct1, UseProduct2, UseProduct3,
                                                            Report_Date);
                data = [select Id, Name, Department_Cateogy__c, ConsumptionOfConsumables__c, WorkRecord__c,EffectProgress__c,WarlockClassification__c,
                            ProductCcategory__c, productCategories__c,warlocksNumber__c,WorkMark__c,ProductClassification__c,DealerPersonnel__c, Agency_Report_Header__c,Agency_Hospital__c,UseProduct1__c,
                            UseProduct2__c, UseProduct3__c,  Person_In_Charge2__c,doctor2__c,Submit_date__c,Report_Date__c
                            from Agency_Report__c where id=:report_id];
                System.assertEquals(Department_Cateogy, data.Department_Cateogy__c);
    
                Department_Cateogy = 'OTH';
                report_id = RetrospectiveWeeklyReportController.editAgencyReport(report_id,Department_Cateogy,ConsumptionOfConsumables,
                                                            WorkMark,warlocksNumber,DealerPersonnel,WarlockClassification,ProductCcategory,productCategories,ProductClassification, 
                                                            EffectProgress,WorkRecord,Agency_Report_Header,
                                                            Agency_Hospital, Person_In_Charge2, doctor, Submit_date,
                                                            UseProduct1, UseProduct2, UseProduct3,
                                                            Report_Date);
                data = [select Id, Name, Department_Cateogy__c, ConsumptionOfConsumables__c, WorkRecord__c,EffectProgress__c,WarlockClassification__c,
                            ProductCcategory__c, productCategories__c,warlocksNumber__c,WorkMark__c,ProductClassification__c,DealerPersonnel__c, Agency_Report_Header__c,Agency_Hospital__c,UseProduct1__c,
                            UseProduct2__c, UseProduct3__c,  Person_In_Charge2__c,doctor2__c,Submit_date__c,Report_Date__c
                            from Agency_Report__c where id=:report_id];
                System.assertEquals(Department_Cateogy, data.Department_Cateogy__c);
    
                Test.stopTest();
            }
        }
        @isTest public static void getReports() {
            saveAgencyReportTest();
            
            System.runAs(user) {
                String date_str = '2022-02-28';
                String person_str = '';
                Test.startTest();
                RetrospectiveWeeklyReportController reports = RetrospectiveWeeklyReportController.getReports(date_str, person_str);
                List<Agency_Report__c> report = RetrospectiveWeeklyReportController.getReportsById(report_id);
                Test.stopTest();
                system.assertEquals(report_id, report[0].Id);
            }
        }
        @isTest public static void processData02() {
            
            testInit();
            OlympusCalendar__c oc1 = new OlympusCalendar__c();
            oc1.Date__c = Date.valueOf('2022-3-1');
            insert oc1;
            OlympusCalendar__c oc2 = new OlympusCalendar__c();
            oc2.Date__c = Date.valueOf('2022-3-2');
            insert oc2;
            OlympusCalendar__c oc3 = new OlympusCalendar__c();
            oc3.Date__c = Date.valueOf('2022-2-28');
            insert oc3;
            Test.startTest();
            System.runAs(user) {
            String reports = RetrospectiveWeeklyReportController.processData('"周,担当,活动日,医院,科室,经销商人员,工作记录,医院人员,产品分类(第三分类),使用产品1(产品型号),使用产品2,使用产品3,效果/进度,科室同类耗材月使用量,术士分类,已采用其他品牌,产品用量,工作标记\r\n,,,,,,,,,,,,,,,,,,\r\n','',null);
            }
            Test.stopTest();
        }
    }