---
schema_version: "1"
id: 9637936c1b09a4982b071e74463a1a006fc7901a322dd39a4bde7456e9d95824
title: TearDown Annotation (Developer Preview)
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexcode/apex_classes_annotation_TearDown.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_annotation_TearDown.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: dc204b54835f5f25b587fb0fed0d182d6c4723fb45b697e23cea7d8fa63a664d
description: Use the TearDown annotation to mark a cleanup method that runs after the test completes, regardless of pass or fail.
---
# TearDown Annotation (Developer Preview)

Use the TearDown annotation to mark a cleanup method that runs after the test completes, regardless of pass or fail.

![Note](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/images/icon_note.png)

#### Note

The Apex Integration Tests feature is available as a developer preview in scratch orgs in Summer ’26 (API version 67.0). The feature isn’t generally available unless or until Salesforce announces its general availability in documentation or in press releases or public statements. All commands, parameters, and other features are subject to change or deprecation at any time, with or without notice. Don't implement functionality developed with these commands or tools in your production package.

The annotation is applied to a static method that runs after the integration test completes, regardless of whether the test passed, failed, or threw an exception. Use this annotation to clean up committed test data. The teardown transaction auto-commits at the end of the execution.

- [← Previous](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_annotation_testsetup.htm "TestSetup Annotation")
- [Next →](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_annotation_testvisible.htm "TestVisible Annotation")

#### See Also

- [Apex Integration Tests (Developer Preview)](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_testing_integration_testing.htm "Use Apex integration tests to write end-to-end tests that exercise real interactions between your Salesforce org and external services, including Agentforce and Data 360, as well as HTTP endpoints. Unlike standard Apex unit tests, integration tests relax callout restrictions and transaction rollback semantics, so your tests can make real service calls, commit data mid-transaction, and make assertions on expected outcomes. As a developer preview feature, integration tests are available only in scratch orgs. You can’t run them in production orgs or during metadata deployments.")