Linked Questions

0
votes
1answer
3k views

Custom metadata type code coverage in test class [duplicate]

I Have a map of custom metadata type Map<String,error_mdt> error error=[select id, DeveloperName from error_mdt].How can we Use meta data types in test class to get code coverage. I have ...
0
votes
1answer
836 views

Test class for Custom Metadata Types [duplicate]

I have a custom metadata type with one field(text) which holds a single value. I am referring this field value in the Lightning Component to pass it as a URL. Apex controller: @AuraEnabled public ...
68
votes
3answers
22k views

What is the difference between Custom Settings and Custom Metadata Types

Summer '15 is going to include the GA release of Custom Metadata Types. See Introducing custom metadata types: the app configuration engine for Force.com Are Custom Metadata Types intended as a ...
25
votes
5answers
36k views

Insert Custom Metadata for Unit Test

I have a controller that is querying custom metadata. I'm attempting to write unit tests to test the queries. Is it possible to insert test custom metadata for the purposes of unit tests?
3
votes
1answer
1k views

How to Make Metadata.Operation deploy work?

Did anyone tried to new Salesforce Summer 17 feature to deploy metadata records and layouts by Apex Code? I tried to use this feature to update custom metadata record and it fails for me. I just ...
2
votes
1answer
223 views

Testing Metadata Using Mock Call Outs to Static Resources

I have a class that is called before the handler method of a trigger to check and see if a Custom Metadata Field is checked and therefore the code in the trigger handler should not be run. I can ...
1
vote
1answer
209 views

system.runas and user's time zone

I am writing a test class for testing an API, which populates the value of an iVAR with the logged in user's time zone. In real time, this API works fine. If the logged in User's time zone is EST, I ...
0
votes
2answers
162 views

insertion fail due to custom metadata in handler

Here is the handler which contains meta data Petrol_Price__mdt due to which my record in test class is not getting inserted. public with sharing class HandlerExpenseManagement{ public void ...
0
votes
1answer
60 views

What is the proper way to enable SeeAllData when working with Event Monitoring Big Objects?

I'm using Event Monitoring & would like to use @SeAllData = true in my unit tests, so that I can leverage pre-existing logs. However, when I enable it & query an Event Monitoring object, I ...
1
vote
1answer
28 views

How to create a unit test for custom objects meta?

We are building a package that creates custom setting with reference to custom objects. Then we use settings to create records for these custom objects. How we can create unit test in the package for ...