Skip to main content
5 events
when toggle format what by license comment
Jan 23, 2019 at 16:05 comment added Fernando Gavinho Can we use a Test.isRunningTest to call Test.setMock ?
Apr 14, 2017 at 22:16 comment added Alex Tennant @TimLewis That will not work. Only the state of the database is retained from @testSetup. Test.setMock(), Test.setCurrentPage() etc do not work in the way you'd like.
Apr 14, 2017 at 18:40 comment added Tim Lewis @Codezilla, another option would be to use a @testSetup method which would setup the Test.setMock
Nov 28, 2016 at 23:23 comment added Codezilla If I used Test.setMock(), wouldn't I have to put that in every single test class that might end up making a callout due to triggers and flows? Wouldn't one concise Test.isRunningTest() check that prevents the actual callout or creates a mock at that point be more reasonable? It seems unreasonable to have to go back and rewrite 20 test classes because I added a trigger.
Apr 6, 2014 at 12:56 history answered Alex Tennant CC BY-SA 3.0