← back to the release
new featureApex

Test External Services and HTTP Callouts in Apex Integration Tests (Developer Preview)

Apex integration tests can now make real HTTP callouts to any endpoint, including External Services via Named Credentials, without mock callouts: the @IntegrationTest annotation relaxes callout restrictions and rollback semantics, @BeforeClass sets up data shared across methods, and @TearDown cleans up committed data. Enable the ApexIntegrationTests feature in the scratch org definition, run tests through the Tooling API runTestsAsynchronous resource (one concurrent integration test, async only), and remove Test.setMock() registrations so real endpoints are hit. Developer preview, scratch orgs only.

identifiers
@IntegrationTest@BeforeClass@TearDownApexIntegrationTestsTest.setMockrunTestsAsynchronousNamed Credentials
flags
off by defaultno action required
how
Add features ApexIntegrationTests to the scratch org definition, annotate the class and methods with @IntegrationTest, and run via /tooling/runTestsAsynchronous.
who
when
Developer preview.
where
Developer Edition scratch orgs.
read it on salesforce.com