From 1727a4f4d02e429475608e60f142a63bc24127bc Mon Sep 17 00:00:00 2001
From: 19626 <1962676589@qq.com>
Date: 星期一, 23 十月 2023 10:07:34 +0800
Subject: [PATCH] 近期修改
---
force-app/main/default/classes/AttachmentReQisHandlerTest.cls | 42 +++++++++++-------------------------------
1 files changed, 11 insertions(+), 31 deletions(-)
diff --git a/force-app/main/default/classes/AttachmentReQisHandlerTest.cls b/force-app/main/default/classes/AttachmentReQisHandlerTest.cls
index c160159..28cf414 100644
--- a/force-app/main/default/classes/AttachmentReQisHandlerTest.cls
+++ b/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;
--
Gitblit v1.9.1