# IntentSubject

Artifact: [androidx.test.ext:truth](https://developer.android.com/jetpack/androidx/releases/test-ext) [View Source](https://cs.android.com/search?q=file:androidx/test/ext/truth/content/IntentSubject.java+class:androidx.test.ext.truth.content.IntentSubject)

*** ** * ** ***

<br />

```
class IntentSubject : Subject
```

<br />

|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html) |||
| ↳ | [com.google.common.truth.Subject](https://truth.dev/api/0.41/com/google/common/truth/Subject.html) ||
|   | ↳ | [androidx.test.ext.truth.content.IntentSubject](https://developer.android.com/reference/kotlin/androidx/test/ext/truth/content/IntentSubject) |

*** ** * ** ***

Subject for making assertions about `https://developer.android.com/reference/android/content/Intent.html`s.

## Summary

| ### Public functions |
|---|---|
| `java-static https://developer.android.com/reference/kotlin/androidx/test/ext/truth/content/IntentSubject!` | `https://developer.android.com/reference/kotlin/androidx/test/ext/truth/content/IntentSubject#assertThat(android.content.Intent)(intent: https://developer.android.com/reference/android/content/Intent.html!)` |
| `https://truth.dev/api/0.41/com/google/common/truth/IterableSubject.html!` | `https://developer.android.com/reference/kotlin/androidx/test/ext/truth/content/IntentSubject#categories()()` |
| `https://developer.android.com/reference/kotlin/androidx/test/ext/truth/os/BundleSubject!` | `https://developer.android.com/reference/kotlin/androidx/test/ext/truth/content/IntentSubject#extras()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/test/ext/truth/content/IntentSubject#filtersEquallyTo(android.content.Intent)(intent: https://developer.android.com/reference/android/content/Intent.html!)` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/test/ext/truth/content/IntentSubject#hasAction(java.lang.String)(action: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/test/ext/truth/content/IntentSubject#hasComponent(android.content.ComponentName)(component: https://developer.android.com/reference/android/content/ComponentName.html!)` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/test/ext/truth/content/IntentSubject#hasComponent(java.lang.String,java.lang.String)(packageName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, className: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/test/ext/truth/content/IntentSubject#hasComponentClass(java.lang.String)(className: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/test/ext/truth/content/IntentSubject#hasComponentClass(java.lang.Class<?>)(componentClass: https://developer.android.com/reference/java/lang/Class.html<*>!)` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/test/ext/truth/content/IntentSubject#hasComponentPackage(java.lang.String)(packageName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/test/ext/truth/content/IntentSubject#hasData(android.net.Uri)(uri: https://developer.android.com/reference/android/net/Uri.html!)` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/test/ext/truth/content/IntentSubject#hasFlags(int)(flag: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Assert that the intent has the given flag set. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/test/ext/truth/content/IntentSubject#hasNoAction()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/test/ext/truth/content/IntentSubject#hasPackage(java.lang.String)(packageName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/test/ext/truth/content/IntentSubject#hasType(java.lang.String)(type: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` |
| `java-static https://truth.dev/api/0.41/com/google/common/truth/Subject.Factory.html<https://developer.android.com/reference/kotlin/androidx/test/ext/truth/content/IntentSubject!, https://developer.android.com/reference/android/content/Intent.html!>!` | `https://developer.android.com/reference/kotlin/androidx/test/ext/truth/content/IntentSubject#intents()()` |

### Inherited functions

From [com.google.common.truth.Subject](https://truth.dev/api/0.41/com/google/common/truth/Subject.html) `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#actualCustomStringRepresentation--()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#equals-java.lang.Object-(o: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!)`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#failWithActual-java.lang.String-java.lang.Object-(key: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#failWithoutActual-com.google.common.truth.Fact-com.google.common.truth.Fact...-(first: https://truth.dev/api/0.41/com/google/common/truth/Fact.html!, rest: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://truth.dev/api/0.41/com/google/common/truth/Fact.html!>!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#hashCode--()`

**This function is deprecated.**
`https://truth.dev/api/0.41/com/google/common/truth/StandardSubjectBuilder.html!` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#ignoreCheck--()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isAnyOf-java.lang.Object-java.lang.Object-java.lang.Object...-(first: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!, second: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!, rest: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!>!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isEqualTo-java.lang.Object-(expected: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isIn-java.lang.Iterable&lt;?&gt;-(iterable: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-iterable/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-iterable/index.html<*>!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isInstanceOf-java.lang.Class&lt;?&gt;-(clazz: https://developer.android.com/reference/java/lang/Class.html<*>!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isNoneOf-java.lang.Object-java.lang.Object-java.lang.Object...-(first: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!, second: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!, rest: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!>!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isNotEqualTo-java.lang.Object-(unexpected: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isNotIn-java.lang.Iterable&lt;?&gt;-(iterable: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-iterable/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-iterable/index.html<*>!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isNotInstanceOf-java.lang.Class&lt;?&gt;-(clazz: https://developer.android.com/reference/java/lang/Class.html<*>!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isNotNull--()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isNotSameInstanceAs-java.lang.Object-(unexpected: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isNull--()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isSameInstanceAs-java.lang.Object-(expected: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#toString--()`

## Public functions

### assertThat

```
java-static fun assertThat(intent: Intent!): IntentSubject!
```

### categories

```
fun categories(): IterableSubject!
```

### extras

```
fun extras(): BundleSubject!
```

### filtersEquallyTo

```
fun filtersEquallyTo(intent: Intent!): Unit
```

### hasAction

```
fun hasAction(action: String!): Unit
```

### hasComponent

```
fun hasComponent(component: ComponentName!): Unit
```

### hasComponent

```
fun hasComponent(packageName: String!, className: String!): Unit
```

### hasComponentClass

```
fun hasComponentClass(className: String!): Unit
```

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/test/ext/truth/content/IntentSubject#hasComponentClass(java.lang.Class<?>)` |   |

### hasComponentClass

```
fun hasComponentClass(componentClass: Class<*>!): Unit
```

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/test/ext/truth/content/IntentSubject#hasComponentClass(java.lang.String)` |   |

### hasComponentPackage

```
fun hasComponentPackage(packageName: String!): Unit
```

### hasData

```
fun hasData(uri: Uri!): Unit
```

### hasFlags

```
fun hasFlags(flag: Int): Unit
```

Assert that the intent has the given flag set.

### hasNoAction

```
fun hasNoAction(): Unit
```

### hasPackage

```
fun hasPackage(packageName: String!): Unit
```

### hasType

```
fun hasType(type: String!): Unit
```

### intents

```
java-static fun intents(): Subject.Factory<IntentSubject!, Intent!>!
```