# BackupRestoreConfig

Artifact: [androidx.test.backup:backup-host](https://developer.android.com/jetpack/androidx/releases/test-backup) [View Source](https://cs.android.com/search?q=file:androidx/test/backup/host/BackupRestoreConfig.kt+class:androidx.test.backup.host.BackupRestoreConfig) Added in [1.0.0-alpha04](https://developer.android.com/jetpack/androidx/releases/test-backup#1.0.0-alpha04)

*** ** * ** ***


```
@MustBeDocumented
@Retention(value = AnnotationRetention.RUNTIME)
@Target(allowedTargets = [AnnotationTarget.CLASS])
annotation BackupRestoreConfig
```

<br />

*** ** * ** ***

Defines global configuration parameters for the Automated Backup and Restore test runner suite.

Applies to the annotated test class and to its `https://docs.junit.org/current/api/org.junit.jupiter.api/org/junit/jupiter/api/Nested.html` test classes, which can override individual attributes.

Tests whose test suite properties name the tested app don't need this annotation: without it, they target that app.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/test/backup/host/BackupRestoreConfig#BackupRestoreConfig(kotlin.String,kotlin.String)(applicationId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, testApplicationId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)` |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/test/backup/host/BackupRestoreConfig#applicationId()` The target application ID/package name being tested, such as "com.example.myapp". |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/test/backup/host/BackupRestoreConfig#testApplicationId()` The package name of the test APK whose `androidx.test.backup.BackupRestoreTestRunner` runs the device actions, such as "com.example.myapp.test". |

## Public constructors

### BackupRestoreConfig

Added in [1.0.0-alpha04](https://developer.android.com/jetpack/androidx/releases/test-backup#1.0.0-alpha04)

```
BackupRestoreConfig(applicationId: String = "", testApplicationId: String = "")
```

## Public properties

### applicationId

```
val applicationId: String
```

The target application ID/package name being tested, such as "com.example.myapp". Defaults to "", which uses the `applicationId` of an enclosing class, or else the tested app that the test suite properties name.

### testApplicationId

```
val testApplicationId: String
```

The package name of the test APK whose `androidx.test.backup.BackupRestoreTestRunner` runs the device actions, such as "com.example.myapp.test". Needed only when several installed test APKs have that runner for the app. Defaults to "", which uses the `testApplicationId` of the nearest enclosing class that sets one, unless this class or a class in between sets `applicationId`. Without one, it uses the only such test APK, or else the one named `<applicationId>.test`. Device actions fail if the test APK that it names isn't installed or has no such runner for the app.