# IntentsRule

Artifact: [androidx.test.espresso:espresso-intents](https://developer.android.com/jetpack/androidx/releases/test-espresso) [View Source](https://cs.android.com/search?q=file:androidx/test/espresso/intent/rule/IntentsRule.kt+class:androidx.test.espresso.intent.rule.IntentsRule)

*** ** * ** ***

<br />

```
class IntentsRule : ExternalResource
```

<br />

|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html) |||
| ↳ | [org.junit.rules.ExternalResource](https://junit.org/junit4/javadoc/latest/org/junit/rules/ExternalResource.html) ||
|   | ↳ | [androidx.test.espresso.intent.rule.IntentsRule](https://developer.android.com/reference/kotlin/androidx/test/espresso/intent/rule/IntentsRule) |

*** ** * ** ***

Rule for performing set up and tear down of Espresso-Intents API.

Usage: `@Rule public IntentsRule intentsRule = new IntentsRule()`

Then in a test method: `Intents.intended(IntentMatchers.hasComponent("com.example.FooActivity"))`

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/test/espresso/intent/rule/IntentsRule#IntentsRule()()` |

| ### Protected functions |
|---|---|
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/test/espresso/intent/rule/IntentsRule#after()()` |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/test/espresso/intent/rule/IntentsRule#before()()` |

### Inherited functions

From [org.junit.rules.ExternalResource](https://junit.org/junit4/javadoc/latest/org/junit/rules/ExternalResource.html) `https://junit.org/junit4/javadoc/latest/org/junit/runners/model/Statement.html` `https://junit.org/junit4/javadoc/latest/org/junit/rules/ExternalResource.html#apply-org.junit.runners.model.Statement-org.junit.runner.Description-(base: https://junit.org/junit4/javadoc/latest/org/junit/runners/model/Statement.html, description: https://junit.org/junit4/javadoc/latest/org/junit/runner/Description.html)`

## Public constructors

### IntentsRule

```
IntentsRule()
```

## Protected functions

### after

```
protected open fun after(): Unit
```

### before

```
protected open fun before(): Unit
```