# DataSourceContractTest.TestResource

Artifact: [androidx.media3:media3-test-utils](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/test/utils/DataSourceContractTest.java+class:androidx.media3.test.utils.DataSourceContractTest.TestResource)

*** ** * ** ***

<br />

```
class DataSourceContractTest.TestResource
```

<br />

*** ** * ** ***

Information about a resource that can be used to test the `https://developer.android.com/reference/kotlin/androidx/media3/datasource/DataSource` instance.

## Summary

| ### Nested types |
|---|
| `class https://developer.android.com/reference/kotlin/androidx/media3/test/utils/DataSourceContractTest.TestResource.Builder` Builder for `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/DataSourceContractTest.TestResource` instances. |

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/DataSourceContractTest.TestResource.Builder!` | `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/DataSourceContractTest.TestResource#buildUpon()()` Returns a `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/DataSourceContractTest.TestResource.Builder` initialized with the values of this instance. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/DataSourceContractTest.TestResource#mayResolveToUnknownLength()()` Returns whether this resource may not report a length. |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte/index.html>!` | `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/DataSourceContractTest.TestResource#expectedBytes()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `@https://developer.android.com/reference/kotlin/androidx/media3/datasource/DataSpec.HttpMethod https://developer.android.com/reference/kotlin/androidx/media3/test/utils/DataSourceContractTest.TestResource#httpMethod()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` | `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/DataSourceContractTest.TestResource#name()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte/index.html>!` | `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/DataSourceContractTest.TestResource#requestBody()` |
| `https://guava.dev/releases/snapshot-android/api/docs/com/google/common/collect/ImmutableMap.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>!` | `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/DataSourceContractTest.TestResource#requestHeaders()` |
| `https://developer.android.com/reference/android/net/Uri.html!` | `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/DataSourceContractTest.TestResource#resolvedUri()` |
| `(https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-map/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>!>!` | `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/DataSourceContractTest.TestResource#responseHeaders()` |
| `(https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-set/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>!` | `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/DataSourceContractTest.TestResource#unexpectedResponseHeaderKeys()` |
| `https://developer.android.com/reference/android/net/Uri.html!` | `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/DataSourceContractTest.TestResource#uri()` |

## Public functions

### buildUpon

```
fun buildUpon(): DataSourceContractTest.TestResource.Builder!
```

Returns a `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/DataSourceContractTest.TestResource.Builder` initialized with the values of this instance.

### mayResolveToUnknownLength

```
fun mayResolveToUnknownLength(): Boolean
```

Returns whether this resource may not report a length.

## Public properties

### expectedBytes

```
val expectedBytes: Array<Byte>!
```

### httpMethod

```
@DataSpec.HttpMethod
val httpMethod: Int
```

### name

```
val name: String?
```

### requestBody

```
val requestBody: Array<Byte>!
```

### requestHeaders

```
val requestHeaders: ImmutableMap<String!, String!>!
```

### resolvedUri

```
val resolvedUri: Uri!
```

### responseHeaders

```
val responseHeaders: (Mutable)Map<String!, (Mutable)List<String!>!>!
```

### unexpectedResponseHeaderKeys

```
val unexpectedResponseHeaderKeys: (Mutable)Set<String!>!
```

### uri

```
val uri: Uri!
```