Skip to content

Commit 41ff188

Browse files
committed
Fjernet avhengighet i testen til en faktisk custom metadata type
1 parent 98f054b commit 41ff188

File tree

3 files changed

+16
-72
lines changed

3 files changed

+16
-72
lines changed

src/platform-utility/CustomMetadataDAO/classes/CustomMetadataDAOTest.cls

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,26 @@ public class CustomMetadataDAOTest {
3737
@IsTest
3838
static void testGetMetadata() {
3939
List<SObject> customMetadataRecords;
40+
String query =
41+
'SELECT MasterLabel ' +
42+
'FROM CustomMetadata__mdt ' +
43+
'WHERE DeveloperName = \'Name\'';
44+
45+
// We set the type to Account in order to not be dependent on any Custom Metadata types
46+
CustomMetadataDAOTest.setMetadata(
47+
query,
48+
(List<SObject>) JSON.deserialize(
49+
'[{"attributes": {"type": "Account"},"MasterLabel":"Label"}]',
50+
List<SObject>.class
51+
)
52+
);
53+
4054
System.Test.startTest();
4155
customMetadataRecords = new CustomMetadataDAO()
42-
.getCustomMetadataRecords(
43-
'SELECT MasterLabel FROM Custom_Meta_DAO_test__mdt'
44-
);
56+
.getCustomMetadataRecords(query);
4557
System.Test.stopTest();
4658
System.assertEquals(
47-
[SELECT MasterLabel FROM Custom_Meta_DAO_test__mdt].size(),
59+
1,
4860
customMetadataRecords.size(),
4961
'Size should match'
5062
);

src/platform-utility/CustomMetadataDAO/layouts/Custom_Meta_DAO_test__mdt-Custom Meta DAO test Layout.layout-meta.xml

Lines changed: 0 additions & 61 deletions
This file was deleted.

src/platform-utility/CustomMetadataDAO/objects/Custom_Meta_DAO_test__mdt/Custom_Meta_DAO_test__mdt.object-meta.xml

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)