# UnitTest

[View Source](https://cs.android.com/search?q=file:com/android/build/api/component/UnitTest.kt+class:com.android.build.api.component.UnitTest) Added in 4.2.0 Deprecated in 7.0.0


```
interface UnitTest : UnitTest
```

<br />

*** ** * ** ***

> [!CAUTION]
> **This interface is deprecated.**   
> Use the com.android.build.api.variant package

Properties for the unit test variant of a module.

## Summary

| ### Inherited functions |
|---|
| From [com.android.build.api.variant.Component](https://developer.android.com/reference/tools/gradle-api/9.4/com/android/build/api/variant/Component) |---|---| | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html` | `@https://docs.gradle.org/current/javadoc/org/gradle/api/Incubating.html https://developer.android.com/reference/tools/gradle-api/9.4/com/android/build/api/variant/Component#computeTaskName(kotlin.String,kotlin.String)(action: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html, subject: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)` Utility method to create unique task name for component. | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `@https://docs.gradle.org/current/javadoc/org/gradle/api/Incubating.html https://developer.android.com/reference/tools/gradle-api/9.4/com/android/build/api/variant/Component#configureJavaCompileTask(kotlin.Function1)(action: (https://docs.gradle.org/current/javadoc/org/gradle/api/tasks/compile/JavaCompile.html) -> https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)` Runs an action to configure Components's java compilation `https://docs.gradle.org/current/javadoc/org/gradle/api/tasks/compile/JavaCompile.html` task. | | `https://docs.gradle.org/current/javadoc/org/gradle/api/artifacts/Configuration.html` | `@https://docs.gradle.org/current/javadoc/org/gradle/api/Incubating.html https://developer.android.com/reference/tools/gradle-api/9.4/com/android/build/api/variant/Component#getResolvableConfiguration(kotlin.String)(sourceSetConfigurationsAffix: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)` Access to the component's resolvable configuration corresponding to the source set configurations added via `https://developer.android.com/reference/tools/gradle-api/9.4/com/android/build/api/variant/AndroidComponentsExtension#addSourceSetConfigurations(kotlin.String)`. | |
| From [com.android.build.api.variant.UnitTest](https://developer.android.com/reference/tools/gradle-api/9.4/com/android/build/api/variant/UnitTest) |---|---| | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `@https://docs.gradle.org/current/javadoc/org/gradle/api/Incubating.html https://developer.android.com/reference/tools/gradle-api/9.4/com/android/build/api/variant/UnitTest#configureTestTask(kotlin.Function1)(action: (https://docs.gradle.org/current/javadoc/org/gradle/api/tasks/testing/Test.html) -> https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)` Runs some action to configure the Variant's unit test `https://docs.gradle.org/current/javadoc/org/gradle/api/tasks/testing/Test.html` task. | |

| ### Inherited properties |
|---|
| From [com.android.build.api.variant.Component](https://developer.android.com/reference/tools/gradle-api/9.4/com/android/build/api/variant/Component) |---|---| | `https://docs.gradle.org/current/javadoc/org/gradle/api/artifacts/Configuration.html` | `https://developer.android.com/reference/tools/gradle-api/9.4/com/android/build/api/variant/Component#annotationProcessorConfiguration()` Access to the variant's annotation processor `https://docs.gradle.org/current/javadoc/org/gradle/api/artifacts/Configuration.html`; for example, the debugAnnotationProcessor `https://docs.gradle.org/current/javadoc/org/gradle/api/artifacts/Configuration.html` for the debug variant. | | `https://developer.android.com/reference/tools/gradle-api/9.4/com/android/build/api/artifact/Artifacts` | `https://developer.android.com/reference/tools/gradle-api/9.4/com/android/build/api/variant/Component#artifacts()` Access to the variant's buildable artifacts for build customization. | | `https://docs.gradle.org/current/javadoc/org/gradle/api/file/FileCollection.html` | `https://developer.android.com/reference/tools/gradle-api/9.4/com/android/build/api/variant/Component#compileClasspath()` Access to the variant's compile classpath. | | `https://docs.gradle.org/current/javadoc/org/gradle/api/artifacts/Configuration.html` | `https://developer.android.com/reference/tools/gradle-api/9.4/com/android/build/api/variant/Component#compileConfiguration()` Access to the variant's compile `https://docs.gradle.org/current/javadoc/org/gradle/api/artifacts/Configuration.html`; for example, the debugCompileClasspath `https://docs.gradle.org/current/javadoc/org/gradle/api/artifacts/Configuration.html` for the debug variant. | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/tools/gradle-api/9.4/com/android/build/api/variant/Component#debuggable()` Whether the produced artifacts will be debuggable | | `https://developer.android.com/reference/tools/gradle-api/9.4/com/android/build/api/variant/Instrumentation` | `https://developer.android.com/reference/tools/gradle-api/9.4/com/android/build/api/variant/Component#instrumentation()` Access to the variant's instrumentation options. | | `https://developer.android.com/reference/tools/gradle-api/9.4/com/android/build/api/variant/JavaCompilation?` | `https://developer.android.com/reference/tools/gradle-api/9.4/com/android/build/api/variant/Component#javaCompilation()` Access to the variant's java compilation options. | | `https://developer.android.com/reference/tools/gradle-api/9.4/com/android/build/api/variant/LifecycleTasks` | `https://developer.android.com/reference/tools/gradle-api/9.4/com/android/build/api/variant/Component#lifecycleTasks()` Provides access to the `https://developer.android.com/reference/tools/gradle-api/9.4/com/android/build/api/variant/LifecycleTasks` created for this component. | | `https://docs.gradle.org/current/javadoc/org/gradle/api/provider/Provider.html<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html>` | `https://developer.android.com/reference/tools/gradle-api/9.4/com/android/build/api/variant/Component#namespace()` The namespace of the generated R and BuildConfig classes. | | `https://docs.gradle.org/current/javadoc/org/gradle/api/artifacts/Configuration.html` | `https://developer.android.com/reference/tools/gradle-api/9.4/com/android/build/api/variant/Component#runtimeConfiguration()` Access to the variant's runtime `https://docs.gradle.org/current/javadoc/org/gradle/api/artifacts/Configuration.html`; for example, the debugRuntimeClasspath `https://docs.gradle.org/current/javadoc/org/gradle/api/artifacts/Configuration.html` for the debug variant. | | `https://developer.android.com/reference/tools/gradle-api/9.4/com/android/build/api/variant/Sources` | `https://developer.android.com/reference/tools/gradle-api/9.4/com/android/build/api/variant/Component#sources()` Access to variant's source files. | |
| From [com.android.build.api.variant.ComponentIdentity](https://developer.android.com/reference/tools/gradle-api/9.4/com/android/build/api/variant/ComponentIdentity) |---|---| | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html?` | `https://developer.android.com/reference/tools/gradle-api/9.4/com/android/build/api/variant/ComponentIdentity#buildType()` Build type name. | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html?` | `https://developer.android.com/reference/tools/gradle-api/9.4/com/android/build/api/variant/ComponentIdentity#flavorName()` The multi-flavor name of the variant. | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/tools/gradle-api/9.4/com/android/build/api/variant/ComponentIdentity#name()` Component's name. | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-pair/index.html<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html, https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html>>` | `https://developer.android.com/reference/tools/gradle-api/9.4/com/android/build/api/variant/ComponentIdentity#productFlavors()` List of flavor names. | |
| From [com.android.build.api.variant.TestComponent](https://developer.android.com/reference/tools/gradle-api/9.4/com/android/build/api/variant/TestComponent) |---|---| | `https://docs.gradle.org/current/javadoc/org/gradle/api/provider/MapProperty.html<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html, https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html>` | `https://developer.android.com/reference/tools/gradle-api/9.4/com/android/build/api/variant/TestComponent#manifestPlaceholders()` `https://docs.gradle.org/current/javadoc/org/gradle/api/provider/MapProperty.html` of the test component's manifest placeholders. | |