{% setvar book_path %}/reference/kotlin/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}
class IntentMatchers
A collection of hamcrest matchers for matching Intent objects.
Public constructors |
|
|---|---|
Public functions |
|
|---|---|
java-static Matcher<Intent>! |
|
java-static Matcher<Intent>! |
doesNotHaveExtraWithKey(key: String!) |
java-static Matcher<Intent>! |
doesNotHaveExtraWithKey(keyMatcher: Matcher<String>!) |
java-static Matcher<Intent>! |
filterEquals(expectedIntent: Intent!)Matches an intent if it Intent#filterEquals(Intent) the expected intent. |
java-static Matcher<Intent>! |
|
java-static Matcher<Intent>! |
hasAction(actionMatcher: Matcher<String>!) |
java-static Matcher<Intent>! |
hasCategories(categories: (Mutable)Set<String!>!) |
java-static Matcher<Intent>! |
hasCategories( |
java-static Matcher<Intent>! |
hasComponent(className: String!)Returns a matcher that will only match intents targeted to a single class by using hasClassName. |
java-static Matcher<Intent>! |
hasComponent(componentName: ComponentName!)Returns a matcher that will only match intents targeted to the componentName's class, {@see * ComponentName#getClassName}. |
java-static Matcher<Intent>! |
hasComponent(componentMatcher: Matcher<ComponentName>!)Can match an intent by class name, package name or short class name. |
java-static Matcher<Intent>! |
|
java-static Matcher<Intent>! |
hasData(uri: Uri!) |
java-static Matcher<Intent>! |
hasData(uriMatcher: Matcher<Uri>!) |
java-static Matcher<Intent>! |
hasDataString(stringMatcher: Matcher<String>!) |
java-static Matcher<Intent>! |
|
java-static Matcher<Intent>! |
|
java-static Matcher<Intent>! |
hasExtra(keyMatcher: Matcher<String>!, valueMatcher: Matcher<?>!) |
java-static Matcher<Intent>! |
hasExtraWithKey(key: String!) |
java-static Matcher<Intent>! |
hasExtraWithKey(keyMatcher: Matcher<String>!) |
java-static Matcher<Intent>! |
hasExtras(bundleMatcher: Matcher<Bundle>!) |
java-static Matcher<Intent>! |
|
java-static Matcher<Intent>! |
|
java-static Matcher<Intent>! |
|
java-static Matcher<Intent>! |
hasPackage(packageMatcher: Matcher<String>!) |
java-static Matcher<Intent>! |
hasPackage(packageName: String!) |
java-static Matcher<Intent>! |
|
java-static Matcher<Intent>! |
hasType(typeMatcher: Matcher<String>!) |
java-static Matcher<Intent>! |
Matches an intent if its package is the same as the target package for the instrumentation test. |
java-static Matcher<Intent>! |
Matches an intent based on the package of activity which can handle the intent. |
java-static fun doesNotHaveExtraWithKey(keyMatcher: Matcher<String>!): Matcher<Intent>!
java-static fun filterEquals(expectedIntent: Intent!): Matcher<Intent>!
Matches an intent if it Intent#filterEquals(Intent) the expected intent.
java-static fun hasCategories(
categoriesMatcher: Matcher<? extends Iterable<? super String>>!
): Matcher<Intent>!
java-static fun hasComponent(className: String!): Matcher<Intent>!
Returns a matcher that will only match intents targeted to a single class by using hasClassName. The input string must contain the package name + short class name. For example hasComponent("com.google.provider.NotePad").
| Parameters | |
|---|---|
className: String! |
complete class path |
java-static fun hasComponent(componentName: ComponentName!): Matcher<Intent>!
Returns a matcher that will only match intents targeted to the componentName's class, {@see * ComponentName#getClassName}. For example: Intent intent = new Intent() .setComponentName(new ComponentName("com.google.provider", "com.google.provider.Notepad")); will match all intents targeted to Notepad.java.
| Parameters | |
|---|---|
componentName: ComponentName! |
a componentName that has the target class specified |
java-static fun hasComponent(componentMatcher: Matcher<ComponentName>!): Matcher<Intent>!
Can match an intent by class name, package name or short class name.
| Parameters | |
|---|---|
componentMatcher: Matcher<ComponentName>! |
can be the value of ComponentNameMatchers#hasClassName, hasPackageName or ComponentNameMatchers#hasShortClassName |
java-static fun hasExtra(keyMatcher: Matcher<String>!, valueMatcher: Matcher<?>!): Matcher<Intent>!
java-static fun isInternal(): Matcher<Intent>!
Matches an intent if its package is the same as the target package for the instrumentation test.