19626
2023-10-23 1727a4f4d02e429475608e60f142a63bc24127bc
force-app/main/default/classes/AttachmentReQisHandlerTest.cls
@@ -57,25 +57,12 @@
        repair.Hospital__c = hospital.Id;
        repair.Delivered_Product__c = asset.Id;
        insert repair;
        // Attachment att = new Attachment(
        //     Name = 'test',
        //     ParentId = repair.Id,
        //     Body = EncodingUtil.base64Decode('test')
        // );
        ContentVersion version = new ContentVersion(
            Title = 'test',
            VersionData = EncodingUtil.base64Decode('test'),
            ContentLocation = 's',
            PathOnClient = 'test.txt'
        Attachment att = new Attachment(
            Name = 'test',
            ParentId = repair.Id,
            Body = EncodingUtil.base64Decode('test')
        );
        insert version;
        version = [select ContentDocumentId from ContentVersion where Id =: version.Id];
        ContentDocumentLink link = new ContentDocumentLink();
        link.ContentDocumentId = version.ContentDocumentId;
        link.LinkedEntityId = repair.Id;
        link.ShareType = 'I';
        link.Visibility = 'AllUsers';
        insert link;
    }
    // 覆盖率补充
@@ -137,20 +124,13 @@
        ofile.Oppor_File_Stage__c = 'G';
        insert ofile;
        ContentVersion version = new ContentVersion(
            Title = 'test',
            VersionData = EncodingUtil.base64Decode('test'),
            ContentLocation = 's',
            PathOnClient = 'test.txt'
        Attachment att1 = new Attachment(
            Name = 'test',
            ParentId = ofile.Id,
            Body = EncodingUtil.base64Decode('test')
        );
        insert version;
        version = [select ContentDocumentId from ContentVersion where Id =: version.Id];
        ContentDocumentLink link = new ContentDocumentLink();
        link.ContentDocumentId = version.ContentDocumentId;
        link.LinkedEntityId = ofile.Id;
        link.ShareType = 'I';
        link.Visibility = 'AllUsers';
        insert link;
        insert att1;
        delete ofile;