# 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 />

```
public final class IntentSubject extends Subject
```

<br />

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.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/androidx/test/ext/truth/content/IntentSubject) |

*** ** * ** ***

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

## Summary

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

### Inherited methods

From [com.google.common.truth.Subject](https://truth.dev/api/0.41/com/google/common/truth/Subject.html) `https://developer.android.com/reference/java/lang/String.html` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#actualCustomStringRepresentation--()` `final boolean` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#equals-java.lang.Object-(https://developer.android.com/reference/java/lang/Object.html o)`

**This method is deprecated.**
`final void` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#failWithActual-java.lang.String-java.lang.Object-(https://developer.android.com/reference/java/lang/String.html key, https://developer.android.com/reference/java/lang/Object.html value)` `final void` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#failWithoutActual-com.google.common.truth.Fact-com.google.common.truth.Fact...-(https://truth.dev/api/0.41/com/google/common/truth/Fact.html first, Fact[] rest)` `final int` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#hashCode--()`

**This method is deprecated.**
`final 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--()` `void` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isAnyOf-java.lang.Object-java.lang.Object-java.lang.Object...-(https://developer.android.com/reference/java/lang/Object.html first, https://developer.android.com/reference/java/lang/Object.html second, Object[] rest)` `void` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isEqualTo-java.lang.Object-(https://developer.android.com/reference/java/lang/Object.html expected)` `void` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isIn-java.lang.Iterable&lt;?&gt;-(https://developer.android.com/reference/java/lang/Iterable.html<@https://developer.android.com/reference/androidx/annotation/NonNull ?> iterable)` `void` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isInstanceOf-java.lang.Class&lt;?&gt;-(https://developer.android.com/reference/java/lang/Class.html<@https://developer.android.com/reference/androidx/annotation/NonNull ?> clazz)` `void` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isNoneOf-java.lang.Object-java.lang.Object-java.lang.Object...-(https://developer.android.com/reference/java/lang/Object.html first, https://developer.android.com/reference/java/lang/Object.html second, Object[] rest)` `void` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isNotEqualTo-java.lang.Object-(https://developer.android.com/reference/java/lang/Object.html unexpected)` `void` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isNotIn-java.lang.Iterable&lt;?&gt;-(https://developer.android.com/reference/java/lang/Iterable.html<@https://developer.android.com/reference/androidx/annotation/NonNull ?> iterable)` `void` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isNotInstanceOf-java.lang.Class&lt;?&gt;-(https://developer.android.com/reference/java/lang/Class.html<@https://developer.android.com/reference/androidx/annotation/NonNull ?> clazz)` `void` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isNotNull--()` `final void` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isNotSameInstanceAs-java.lang.Object-(https://developer.android.com/reference/java/lang/Object.html unexpected)` `void` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isNull--()` `final void` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isSameInstanceAs-java.lang.Object-(https://developer.android.com/reference/java/lang/Object.html expected)` `https://developer.android.com/reference/java/lang/String.html` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#toString--()`

## Public methods

### assertThat

```
public static IntentSubject assertThat(Intent intent)
```

### categories

```
public final IterableSubject categories()
```

### extras

```
public final BundleSubject extras()
```

### filtersEquallyTo

```
public final void filtersEquallyTo(Intent intent)
```

### hasAction

```
public final void hasAction(String action)
```

### hasComponent

```
public final void hasComponent(ComponentName component)
```

### hasComponent

```
public final void hasComponent(String packageName, String className)
```

### hasComponentClass

```
public final void hasComponentClass(String className)
```

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

### hasComponentClass

```
public final void hasComponentClass(Class<@NonNull ?> componentClass)
```

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

### hasComponentPackage

```
public final void hasComponentPackage(String packageName)
```

### hasData

```
public final void hasData(Uri uri)
```

### hasFlags

```
public final void hasFlags(int flag)
```

Assert that the intent has the given flag set.

### hasNoAction

```
public final void hasNoAction()
```

### hasPackage

```
public final void hasPackage(String packageName)
```

### hasType

```
public final void hasType(String type)
```

### intents

```
public static Subject.Factory<IntentSubject, Intent> intents()
```