# FakeHealthConnectClientOverrides

Artifact: [androidx.health.connect:connect-testing](https://developer.android.com/jetpack/androidx/releases/health-connect) [View Source](https://cs.android.com/search?q=file:androidx/health/connect/client/testing/FakeHealthConnectClientOverrides.kt+class:androidx.health.connect.client.testing.FakeHealthConnectClientOverrides) Added in [1.0.0-alpha04](https://developer.android.com/jetpack/androidx/releases/health-connect#1.0.0-alpha04)

*** ** * ** ***


```
public final class FakeHealthConnectClientOverrides
```

<br />

*** ** * ** ***

Used to override or intercept responses to emulate scenarios that `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClient` doesn't support.

Every call in `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClient` can be overridden.

For example:

```kotlin
import androidx.health.connect.client.testing.stubs.stub

// Sets a default return value for client.aggregate() and a queue with one item.
client.overrides.aggregate = stub(queue = listOf(resultOnce)) { result }
```

```kotlin
import androidx.health.connect.client.aggregate.AggregationResult
import androidx.health.connect.client.testing.AggregationResult
import androidx.health.connect.client.testing.stubs.MutableStub
import androidx.health.connect.client.testing.stubs.enqueue

// Sets a default exception that will be thrown for client.aggregate().
val aggregationStub = MutableStub<AggregationResult>(exception)
client.overrides.aggregate = aggregationStub

// Only the first call to client.aggregate() will return this result. Subsequent calls will
// throw the default.
aggregationStub.enqueue(result)

// Setting a default response removes the default exception.
aggregationStub.defaultHandler = { AggregationResult() }
```

```kotlin
import androidx.health.connect.client.aggregate.AggregationResult
import androidx.health.connect.client.records.ExerciseSessionRecord
import androidx.health.connect.client.records.HeartRateRecord
import androidx.health.connect.client.testing.AggregationResult
import androidx.health.connect.client.testing.stubs.stub

val result =
    AggregationResult(
        metrics =
            buildMap {
                put(HeartRateRecord.BPM_AVG, 74.0)
                put(ExerciseSessionRecord.EXERCISE_DURATION_TOTAL, Duration.ofMinutes(30))
            }
    )
client.overrides.aggregate = stub(result)
```

```kotlin
import androidx.health.connect.client.aggregate.AggregationResult
import androidx.health.connect.client.aggregate.AggregationResultGroupedByDuration
import androidx.health.connect.client.testing.AggregationResult
import androidx.health.connect.client.testing.stubs.stub

val result = buildList {
    add(
        AggregationResultGroupedByDuration(
            aggregationResult1,
            startTime1,
            endTime1,
            ZoneOffset.UTC,
        )
    )
    add(
        AggregationResultGroupedByDuration(
            aggregationResult2,
            startTime2,
            endTime2,
            ZoneOffset.UTC,
        )
    )
}
client.overrides.aggregateGroupByDuration = stub(default = result)
```

```kotlin
import androidx.health.connect.client.aggregate.AggregationResult
import androidx.health.connect.client.aggregate.AggregationResultGroupedByPeriod
import androidx.health.connect.client.testing.AggregationResult
import androidx.health.connect.client.testing.stubs.stub

val result = buildList {
    add(AggregationResultGroupedByPeriod(aggregationResult1, startTime1, endTime1))
    add(AggregationResultGroupedByPeriod(aggregationResult2, startTime2, endTime2))
}
client.overrides.aggregateGroupByPeriod = stub(default = result)
```

```kotlin
import androidx.health.connect.client.aggregate.AggregationResult
import androidx.health.connect.client.records.ExerciseSessionRecord
import androidx.health.connect.client.records.HeartRateRecord
import androidx.health.connect.client.testing.AggregationResult
import androidx.health.connect.client.testing.stubs.stub

val result =
    AggregationResult(
        metrics =
            buildMap {
                put(HeartRateRecord.BPM_AVG, 74.0)
                put(ExerciseSessionRecord.EXERCISE_DURATION_TOTAL, Duration.ofMinutes(30))
            }
    )
client.overrides.aggregate = stub(result)
```

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClientOverrides#FakeHealthConnectClientOverrides(androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub)( https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/response/ChangesResponse> getChanges, https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/request/ChangesTokenRequest, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html> getChangesToken, https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/request/ReadRecordsRequest<@https://developer.android.com/reference/androidx/annotation/NonNull ?>, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/response/ReadRecordsResponse<@https://developer.android.com/reference/androidx/annotation/NonNull ?>> readRecords, https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/response/ReadRecordResponse<@https://developer.android.com/reference/androidx/annotation/NonNull ?>> readRecord, https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull ?>, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/response/InsertRecordsResponse> insertRecords, https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Object.html, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Void.html> updateRecords, https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Object.html, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Void.html> deleteRecords, https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/request/AggregateRequest, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/aggregate/AggregationResult> aggregate, https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/request/AggregateGroupByDurationRequest, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/aggregate/AggregationResultGroupedByDuration>> aggregateGroupByDuration, https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/request/AggregateGroupByPeriodRequest, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/aggregate/AggregationResultGroupedByPeriod>> aggregateGroupByPeriod )` |

| ### Public methods |
|---|---|
| `final https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/request/AggregateRequest, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/aggregate/AggregationResult>` | `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClientOverrides#getAggregate()()` A `https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub` used to set the next responses used in `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClient#aggregate(androidx.health.connect.client.request.AggregateRequest)`. |
| `final https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/request/AggregateGroupByDurationRequest, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/aggregate/AggregationResultGroupedByDuration>>` | `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClientOverrides#getAggregateGroupByDuration()()` A `https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub` used to set the next responses used in `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClient#aggregateGroupByDuration(androidx.health.connect.client.request.AggregateGroupByDurationRequest)`. |
| `final https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/request/AggregateGroupByPeriodRequest, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/aggregate/AggregationResultGroupedByPeriod>>` | `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClientOverrides#getAggregateGroupByPeriod()()` A `https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub` used to set the next responses used in `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClient#aggregateGroupByPeriod(androidx.health.connect.client.request.AggregateGroupByPeriodRequest)`. |
| `final https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Object.html, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Void.html>` | `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClientOverrides#getDeleteRecords()()` A `https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub` used only to throw exceptions in `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClientOverrides#(androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub)`. |
| `final https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/response/ChangesResponse>` | `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClientOverrides#getGetChanges()()` A `https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub` used to set the next responses used in `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClientOverrides#(androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub)`. |
| `final https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/request/ChangesTokenRequest, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html>` | `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClientOverrides#getGetChangesToken()()` A `https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub` used to set the next responses used in `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClientOverrides#(androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub)`. |
| `final https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull ?>, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/response/InsertRecordsResponse>` | `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClientOverrides#getInsertRecords()()` A `https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub` used to set the next responses used in `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClientOverrides#(androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub)`. |
| `final https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/response/ReadRecordResponse<@https://developer.android.com/reference/androidx/annotation/NonNull ?>>` | `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClientOverrides#getReadRecord()()` A `https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub` used to set the next responses used in `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClientOverrides#(androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub)`. |
| `final https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/request/ReadRecordsRequest<@https://developer.android.com/reference/androidx/annotation/NonNull ?>, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/response/ReadRecordsResponse<@https://developer.android.com/reference/androidx/annotation/NonNull ?>>` | `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClientOverrides#getReadRecords()()` A `https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub` used to set the next responses used in `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClientOverrides#(androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub)`. |
| `final https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Object.html, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Void.html>` | `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClientOverrides#getUpdateRecords()()` A `https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub` used only to throw exceptions in `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClientOverrides#(androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub)`. |
| `final void` | `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClientOverrides#setAggregate(androidx.health.connect.client.testing.stubs.Stub)( https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/request/AggregateRequest, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/aggregate/AggregationResult> value )` A `https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub` used to set the next responses used in `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClient#aggregate(androidx.health.connect.client.request.AggregateRequest)`. |
| `final void` | `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClientOverrides#setAggregateGroupByDuration(androidx.health.connect.client.testing.stubs.Stub)( https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/request/AggregateGroupByDurationRequest, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/aggregate/AggregationResultGroupedByDuration>> value )` A `https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub` used to set the next responses used in `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClient#aggregateGroupByDuration(androidx.health.connect.client.request.AggregateGroupByDurationRequest)`. |
| `final void` | `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClientOverrides#setAggregateGroupByPeriod(androidx.health.connect.client.testing.stubs.Stub)( https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/request/AggregateGroupByPeriodRequest, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/aggregate/AggregationResultGroupedByPeriod>> value )` A `https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub` used to set the next responses used in `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClient#aggregateGroupByPeriod(androidx.health.connect.client.request.AggregateGroupByPeriodRequest)`. |
| `final void` | `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClientOverrides#setDeleteRecords(androidx.health.connect.client.testing.stubs.Stub)(https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Object.html, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Void.html> value)` A `https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub` used only to throw exceptions in `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClientOverrides#(androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub)`. |
| `final void` | `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClientOverrides#setGetChanges(androidx.health.connect.client.testing.stubs.Stub)(https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/response/ChangesResponse> value)` A `https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub` used to set the next responses used in `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClientOverrides#(androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub)`. |
| `final void` | `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClientOverrides#setGetChangesToken(androidx.health.connect.client.testing.stubs.Stub)( https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/request/ChangesTokenRequest, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html> value )` A `https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub` used to set the next responses used in `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClientOverrides#(androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub)`. |
| `final void` | `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClientOverrides#setInsertRecords(androidx.health.connect.client.testing.stubs.Stub)( https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull ?>, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/response/InsertRecordsResponse> value )` A `https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub` used to set the next responses used in `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClientOverrides#(androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub)`. |
| `final void` | `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClientOverrides#setReadRecord(androidx.health.connect.client.testing.stubs.Stub)( https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/response/ReadRecordResponse<@https://developer.android.com/reference/androidx/annotation/NonNull ?>> value )` A `https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub` used to set the next responses used in `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClientOverrides#(androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub)`. |
| `final void` | `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClientOverrides#setReadRecords(androidx.health.connect.client.testing.stubs.Stub)( https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/request/ReadRecordsRequest<@https://developer.android.com/reference/androidx/annotation/NonNull ?>, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/response/ReadRecordsResponse<@https://developer.android.com/reference/androidx/annotation/NonNull ?>> value )` A `https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub` used to set the next responses used in `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClientOverrides#(androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub)`. |
| `final void` | `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClientOverrides#setUpdateRecords(androidx.health.connect.client.testing.stubs.Stub)(https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Object.html, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Void.html> value)` A `https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub` used only to throw exceptions in `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClientOverrides#(androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub)`. |

## Public constructors

### FakeHealthConnectClientOverrides

```
public FakeHealthConnectClientOverrides(
    Stub<@NonNull String, @NonNull ChangesResponse> getChanges,
    Stub<@NonNull ChangesTokenRequest, @NonNull String> getChangesToken,
    Stub<@NonNull ReadRecordsRequest<@NonNull ?>, @NonNull ReadRecordsResponse<@NonNull ?>> readRecords,
    Stub<@NonNull String, @NonNull ReadRecordResponse<@NonNull ?>> readRecord,
    Stub<@NonNull List<@NonNull ?>, @NonNull InsertRecordsResponse> insertRecords,
    Stub<@NonNull Object, @NonNull Void> updateRecords,
    Stub<@NonNull Object, @NonNull Void> deleteRecords,
    Stub<@NonNull AggregateRequest, @NonNull AggregationResult> aggregate,
    Stub<@NonNull AggregateGroupByDurationRequest, @NonNull List<@NonNull AggregationResultGroupedByDuration>> aggregateGroupByDuration,
    Stub<@NonNull AggregateGroupByPeriodRequest, @NonNull List<@NonNull AggregationResultGroupedByPeriod>> aggregateGroupByPeriod
)
```

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/response/ChangesResponse> getChanges` | A `https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub` used only to throw exceptions in `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClientOverrides#getChanges()`. |
| `https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/request/ChangesTokenRequest, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html> getChangesToken` | A `https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub` used only to throw exceptions in `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClientOverrides#getChangesToken()`. |
| `https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/request/ReadRecordsRequest<@https://developer.android.com/reference/androidx/annotation/NonNull ?>, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/response/ReadRecordsResponse<@https://developer.android.com/reference/androidx/annotation/NonNull ?>> readRecords` | A `https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub` used only to throw exceptions in `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClientOverrides#readRecords()`. |
| `https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/response/ReadRecordResponse<@https://developer.android.com/reference/androidx/annotation/NonNull ?>> readRecord` | A `https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub` used only to throw exceptions in `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClientOverrides#readRecord()`. |
| `https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull ?>, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/response/InsertRecordsResponse> insertRecords` | A `https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub` used only to throw exceptions in `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClientOverrides#insertRecords()`. |
| `https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Object.html, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Void.html> updateRecords` | A `https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub` used only to throw exceptions in `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClientOverrides#updateRecords()`. |
| `https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Object.html, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Void.html> deleteRecords` | A `https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub` used only to throw exceptions in `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClientOverrides#deleteRecords()`. |
| `https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/request/AggregateRequest, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/aggregate/AggregationResult> aggregate` | A `https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub` used to set the next responses used in `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClient#aggregate(androidx.health.connect.client.request.AggregateRequest)`. |
| `https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/request/AggregateGroupByDurationRequest, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/aggregate/AggregationResultGroupedByDuration>> aggregateGroupByDuration` | A `https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub` used to set the next responses used in `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClient#aggregateGroupByDuration(androidx.health.connect.client.request.AggregateGroupByDurationRequest)`. |
| `https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/request/AggregateGroupByPeriodRequest, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/aggregate/AggregationResultGroupedByPeriod>> aggregateGroupByPeriod` | A `https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub` used to set the next responses used in `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClient#aggregateGroupByPeriod(androidx.health.connect.client.request.AggregateGroupByPeriodRequest)`. |

## Public methods

### getAggregate

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

```
public final Stub<@NonNull AggregateRequest, @NonNull AggregationResult> getAggregate()
```

A `https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub` used to set the next responses used in `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClient#aggregate(androidx.health.connect.client.request.AggregateRequest)`.

```kotlin
import androidx.health.connect.client.aggregate.AggregationResult
import androidx.health.connect.client.records.ExerciseSessionRecord
import androidx.health.connect.client.records.HeartRateRecord
import androidx.health.connect.client.testing.AggregationResult
import androidx.health.connect.client.testing.stubs.stub

val result =
    AggregationResult(
        metrics =
            buildMap {
                put(HeartRateRecord.BPM_AVG, 74.0)
                put(ExerciseSessionRecord.EXERCISE_DURATION_TOTAL, Duration.ofMinutes(30))
            }
    )
client.overrides.aggregate = stub(result)
```

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClientOverrides#(androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub)` |   |
| `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClientOverrides#(androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub)` |   |

### getAggregateGroupByDuration

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

```
public final Stub<@NonNull AggregateGroupByDurationRequest, @NonNull List<@NonNull AggregationResultGroupedByDuration>> getAggregateGroupByDuration()
```

A `https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub` used to set the next responses used in `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClient#aggregateGroupByDuration(androidx.health.connect.client.request.AggregateGroupByDurationRequest)`.

```kotlin
import androidx.health.connect.client.aggregate.AggregationResult
import androidx.health.connect.client.aggregate.AggregationResultGroupedByDuration
import androidx.health.connect.client.testing.AggregationResult
import androidx.health.connect.client.testing.stubs.stub

val result = buildList {
    add(
        AggregationResultGroupedByDuration(
            aggregationResult1,
            startTime1,
            endTime1,
            ZoneOffset.UTC,
        )
    )
    add(
        AggregationResultGroupedByDuration(
            aggregationResult2,
            startTime2,
            endTime2,
            ZoneOffset.UTC,
        )
    )
}
client.overrides.aggregateGroupByDuration = stub(default = result)
```

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClientOverrides#(androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub)` |   |
| `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClientOverrides#(androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub)` |   |

### getAggregateGroupByPeriod

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

```
public final Stub<@NonNull AggregateGroupByPeriodRequest, @NonNull List<@NonNull AggregationResultGroupedByPeriod>> getAggregateGroupByPeriod()
```

A `https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub` used to set the next responses used in `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClient#aggregateGroupByPeriod(androidx.health.connect.client.request.AggregateGroupByPeriodRequest)`.

```kotlin
import androidx.health.connect.client.aggregate.AggregationResult
import androidx.health.connect.client.aggregate.AggregationResultGroupedByPeriod
import androidx.health.connect.client.testing.AggregationResult
import androidx.health.connect.client.testing.stubs.stub

val result = buildList {
    add(AggregationResultGroupedByPeriod(aggregationResult1, startTime1, endTime1))
    add(AggregationResultGroupedByPeriod(aggregationResult2, startTime2, endTime2))
}
client.overrides.aggregateGroupByPeriod = stub(default = result)
```

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClientOverrides#(androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub)` |   |
| `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClientOverrides#(androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub)` |   |

### getDeleteRecords

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

```
public final Stub<@NonNull Object, @NonNull Void> getDeleteRecords()
```

A `https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub` used only to throw exceptions in `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClientOverrides#(androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub)`.

### getGetChanges

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

```
public final Stub<@NonNull String, @NonNull ChangesResponse> getGetChanges()
```

A `https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub` used to set the next responses used in `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClientOverrides#(androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub)`.

### getGetChangesToken

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

```
public final Stub<@NonNull ChangesTokenRequest, @NonNull String> getGetChangesToken()
```

A `https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub` used to set the next responses used in `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClientOverrides#(androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub)`.

### getInsertRecords

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

```
public final Stub<@NonNull List<@NonNull ?>, @NonNull InsertRecordsResponse> getInsertRecords()
```

A `https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub` used to set the next responses used in `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClientOverrides#(androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub)`.

### getReadRecord

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

```
public final Stub<@NonNull String, @NonNull ReadRecordResponse<@NonNull ?>> getReadRecord()
```

A `https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub` used to set the next responses used in `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClientOverrides#(androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub)`.

### getReadRecords

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

```
public final Stub<@NonNull ReadRecordsRequest<@NonNull ?>, @NonNull ReadRecordsResponse<@NonNull ?>> getReadRecords()
```

A `https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub` used to set the next responses used in `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClientOverrides#(androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub)`.

### getUpdateRecords

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

```
public final Stub<@NonNull Object, @NonNull Void> getUpdateRecords()
```

A `https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub` used only to throw exceptions in `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClientOverrides#(androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub)`.

### setAggregate

```
public final void setAggregate(
    Stub<@NonNull AggregateRequest, @NonNull AggregationResult> value
)
```

A `https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub` used to set the next responses used in `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClient#aggregate(androidx.health.connect.client.request.AggregateRequest)`.

```kotlin
import androidx.health.connect.client.aggregate.AggregationResult
import androidx.health.connect.client.records.ExerciseSessionRecord
import androidx.health.connect.client.records.HeartRateRecord
import androidx.health.connect.client.testing.AggregationResult
import androidx.health.connect.client.testing.stubs.stub

val result =
    AggregationResult(
        metrics =
            buildMap {
                put(HeartRateRecord.BPM_AVG, 74.0)
                put(ExerciseSessionRecord.EXERCISE_DURATION_TOTAL, Duration.ofMinutes(30))
            }
    )
client.overrides.aggregate = stub(result)
```

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClientOverrides#(androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub)` |   |
| `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClientOverrides#(androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub)` |   |

### setAggregateGroupByDuration

```
public final void setAggregateGroupByDuration(
    Stub<@NonNull AggregateGroupByDurationRequest, @NonNull List<@NonNull AggregationResultGroupedByDuration>> value
)
```

A `https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub` used to set the next responses used in `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClient#aggregateGroupByDuration(androidx.health.connect.client.request.AggregateGroupByDurationRequest)`.

```kotlin
import androidx.health.connect.client.aggregate.AggregationResult
import androidx.health.connect.client.aggregate.AggregationResultGroupedByDuration
import androidx.health.connect.client.testing.AggregationResult
import androidx.health.connect.client.testing.stubs.stub

val result = buildList {
    add(
        AggregationResultGroupedByDuration(
            aggregationResult1,
            startTime1,
            endTime1,
            ZoneOffset.UTC,
        )
    )
    add(
        AggregationResultGroupedByDuration(
            aggregationResult2,
            startTime2,
            endTime2,
            ZoneOffset.UTC,
        )
    )
}
client.overrides.aggregateGroupByDuration = stub(default = result)
```

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClientOverrides#(androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub)` |   |
| `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClientOverrides#(androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub)` |   |

### setAggregateGroupByPeriod

```
public final void setAggregateGroupByPeriod(
    Stub<@NonNull AggregateGroupByPeriodRequest, @NonNull List<@NonNull AggregationResultGroupedByPeriod>> value
)
```

A `https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub` used to set the next responses used in `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClient#aggregateGroupByPeriod(androidx.health.connect.client.request.AggregateGroupByPeriodRequest)`.

```kotlin
import androidx.health.connect.client.aggregate.AggregationResult
import androidx.health.connect.client.aggregate.AggregationResultGroupedByPeriod
import androidx.health.connect.client.testing.AggregationResult
import androidx.health.connect.client.testing.stubs.stub

val result = buildList {
    add(AggregationResultGroupedByPeriod(aggregationResult1, startTime1, endTime1))
    add(AggregationResultGroupedByPeriod(aggregationResult2, startTime2, endTime2))
}
client.overrides.aggregateGroupByPeriod = stub(default = result)
```

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClientOverrides#(androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub)` |   |
| `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClientOverrides#(androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub)` |   |

### setDeleteRecords

```
public final void setDeleteRecords(Stub<@NonNull Object, @NonNull Void> value)
```

A `https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub` used only to throw exceptions in `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClientOverrides#(androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub)`.

### setGetChanges

```
public final void setGetChanges(Stub<@NonNull String, @NonNull ChangesResponse> value)
```

A `https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub` used to set the next responses used in `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClientOverrides#(androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub)`.

### setGetChangesToken

```
public final void setGetChangesToken(
    Stub<@NonNull ChangesTokenRequest, @NonNull String> value
)
```

A `https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub` used to set the next responses used in `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClientOverrides#(androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub)`.

### setInsertRecords

```
public final void setInsertRecords(
    Stub<@NonNull List<@NonNull ?>, @NonNull InsertRecordsResponse> value
)
```

A `https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub` used to set the next responses used in `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClientOverrides#(androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub)`.

### setReadRecord

```
public final void setReadRecord(
    Stub<@NonNull String, @NonNull ReadRecordResponse<@NonNull ?>> value
)
```

A `https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub` used to set the next responses used in `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClientOverrides#(androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub)`.

### setReadRecords

```
public final void setReadRecords(
    Stub<@NonNull ReadRecordsRequest<@NonNull ?>, @NonNull ReadRecordsResponse<@NonNull ?>> value
)
```

A `https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub` used to set the next responses used in `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClientOverrides#(androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub)`.

### setUpdateRecords

```
public final void setUpdateRecords(Stub<@NonNull Object, @NonNull Void> value)
```

A `https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub` used only to throw exceptions in `https://developer.android.com/reference/androidx/health/connect/client/testing/FakeHealthConnectClientOverrides#(androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub)`.