# android.test.mock

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

# android.test.mock

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/test/mock/package-summary "View this page in Kotlin")\|Java

Utility classes providing stubs or mocks of various Android framework building blocks.

For more information, see the[Testing](https://developer.android.com/tools/testing)guide.

<br />

## Classes

|------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [MockAccountManager](https://developer.android.com/reference/android/test/mock/MockAccountManager)   | *This class was deprecated in API level 28. Use a mocking framework like[Mockito](https://github.com/mockito/mockito). New tests should be written using the[Android Testing Support Library](https://developer.android.com/ tools/testing-support-library).* |
| [MockApplication](https://developer.android.com/reference/android/test/mock/MockApplication)         | *This class was deprecated in API level 24. Use a mocking framework like[Mockito](https://github.com/mockito/mockito). New tests should be written using the[Android Testing Support Library](https://developer.android.com/tools/testing-support-library).*  |
| [MockContentProvider](https://developer.android.com/reference/android/test/mock/MockContentProvider) | Mock implementation of ContentProvider.                                                                                                                                                                                                                       |
| [MockContentResolver](https://developer.android.com/reference/android/test/mock/MockContentResolver) | An extension of[ContentResolver](https://developer.android.com/reference/android/content/ContentResolver)that is designed for testing.                                                                                                                        |
| [MockContext](https://developer.android.com/reference/android/test/mock/MockContext)                 | A mock[Context](https://developer.android.com/reference/android/content/Context)class.                                                                                                                                                                        |
| [MockCursor](https://developer.android.com/reference/android/test/mock/MockCursor)                   | *This class was deprecated in API level 24. Use a mocking framework like[Mockito](https://github.com/mockito/mockito). New tests should be written using the[Android Testing Support Library](https://developer.android.com/tools/testing-support-library).*  |
| [MockDialogInterface](https://developer.android.com/reference/android/test/mock/MockDialogInterface) | *This class was deprecated in API level 24. Use a mocking framework like[Mockito](https://github.com/mockito/mockito). New tests should be written using the[Android Testing Support Library](https://developer.android.com/tools/testing-support-library).*  |
| [MockPackageManager](https://developer.android.com/reference/android/test/mock/MockPackageManager)   | *This class was deprecated in API level 24. Use a mocking framework like[Mockito](https://github.com/mockito/mockito). New tests should be written using the[Android Testing Support Library](https://developer.android.com/tools/testing-support-library).*  |
| [MockResources](https://developer.android.com/reference/android/test/mock/MockResources)             | *This class was deprecated in API level 24. Use a mocking framework like[Mockito](https://github.com/mockito/mockito). New tests should be written using the[Android Testing Support Library](https://developer.android.com/tools/testing-support-library).*  |
| [MockService](https://developer.android.com/reference/android/test/mock/MockService)                 | *This class was deprecated in API level 28. Use a mocking framework like[Mockito](https://github.com/mockito/mockito). New tests should be written using the[Android Testing Support Library](https://developer.android.com/tools/testing-support-library).*  |

-

  ## Classes

  - [MockAccountManager](https://developer.android.com/reference/android/test/mock/MockAccountManager)
  - [MockApplication](https://developer.android.com/reference/android/test/mock/MockApplication)
  - [MockContentProvider](https://developer.android.com/reference/android/test/mock/MockContentProvider)
  - [MockContentResolver](https://developer.android.com/reference/android/test/mock/MockContentResolver)
  - [MockContext](https://developer.android.com/reference/android/test/mock/MockContext)
  - [MockCursor](https://developer.android.com/reference/android/test/mock/MockCursor)
  - [MockDialogInterface](https://developer.android.com/reference/android/test/mock/MockDialogInterface)
  - [MockPackageManager](https://developer.android.com/reference/android/test/mock/MockPackageManager)
  - [MockResources](https://developer.android.com/reference/android/test/mock/MockResources)
  - [MockService](https://developer.android.com/reference/android/test/mock/MockService)