From fd9df05c48c09b4d7f39a3b401882bda226dedea Mon Sep 17 00:00:00 2001
From: 19626 <1962676589@qq.com>
Date: 星期二, 31 十月 2023 20:38:18 +0800
Subject: [PATCH] 近期修改

---
 force-app/main/default/classes/BidAnnounceIframeControllerTest.cls |   20 +++++++++++++++-----
 1 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/force-app/main/default/classes/BidAnnounceIframeControllerTest.cls b/force-app/main/default/classes/BidAnnounceIframeControllerTest.cls
index e3bb1eb..6f45c82 100644
--- a/force-app/main/default/classes/BidAnnounceIframeControllerTest.cls
+++ b/force-app/main/default/classes/BidAnnounceIframeControllerTest.cls
@@ -31,16 +31,26 @@
         BidAnnounceIframeController controller = new BidAnnounceIframeController(new ApexPages.StandardController(ba));
         controller.init();
         
-        Attachment att = new Attachment(
-            Name = 'test',
-            ParentId = ba.Id,
-            Body = EncodingUtil.base64Decode('test')
+        ContentVersion version = new ContentVersion(
+            Title = 'test',
+            VersionData = EncodingUtil.base64Decode('test'),
+            ContentLocation = 's',
+            PathOnClient = 'test.txt'
         );
-        insert att;
+        insert version;
+        version = [select ContentDocumentId from ContentVersion where Id =: version.Id];
+        ContentDocumentLink link = new ContentDocumentLink();
+        link.ContentDocumentId = version.ContentDocumentId;
+        link.LinkedEntityId = ba.Id;
+        link.ShareType = 'V';
+        link.Visibility = 'AllUsers';
+        Test.startTest();
+        insert link;
         controller.init();
         
         ba.Web_URL__c = '';
         update ba;
         controller.init();
+        delete link;
     }
 }
\ No newline at end of file

--
Gitblit v1.9.1