# 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])
public 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 methods |
|---|---|
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/test/backup/host/BackupRestoreConfig#getApplicationId()()` The target application ID/package name being tested, such as "com.example.myapp". |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/test/backup/host/BackupRestoreConfig#getTestApplicationId()()` The package name of the test APK whose `androidx.test.backup.BackupRestoreTestRunner` runs the device actions, such as "com.example.myapp.test". |

## Public methods

### getApplicationId

```
public final @NonNull String getApplicationId()
```

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.

### getTestApplicationId

```
public final @NonNull String getTestApplicationId()
```

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.