QuestionQ103Verified/TestingCopy linkReport a problemAsk AstroTutorSave questionWhich two methods are recommended for creating test data in Salesforce?Choose twoAUtilize Heroku Connect to provide test class dataBHost a mock endpoint to produce sample information from an endpointCLoad a CSV as a static resource and reference it in a test classDReference data from middleware directly within your test classShow AnswerAnswerExplanationControlled static CSV resources can supply repeatable records to Apex tests through Test.loadData. Endpoint-dependent code should use mock responses so tests remain isolated and deterministic rather than depending on a live middleware or external integration.Learn moreMonth of Testing: Advanced Topics in Salesforce Unit TestingTesting HTTP Callouts with Static Data in Winter ’13Show comments0Show commentsCommunity DiscussionNo comments yet. Be the first to start the discussion!
Community Discussion