-
public final class IntentBuilderClass for building Intent matchers
-
-
Constructor Summary
Constructors Constructor Description IntentBuilder()
-
Method Summary
Modifier and Type Method Description final Unitany()Matches any intent final UnithasAction(String action)Matches intent with given action final UnithasAction(Matcher<String> action)Matches intent with given action final UnithasCategories(String categories)Matches intent with given categories final UnithasCategories(Matcher<out Iterable<String>> categories)Matches intent with given categories final UnithasComponent(String className)Matches intent which component has given class name final UnithasComponent(ComponentName component)Matches intent with given component final UnithasComponent(Matcher<ComponentName> component)Matches intent with given component final UnithasComponent(Function1<ComponentNameBuilder, Unit> function)Matches intent with given component final UnithasData(String uri)Matches intent with given data final UnithasData(Uri uri)Matches intent with given data final UnithasData(Matcher<Uri> uri)Matches intent with given data final UnithasData(Function1<UriBuilder, Unit> function)Matches intent with given data final UnithasExtra(String key, Object value)Matches intent with given extra final UnithasExtra(Matcher<String> key, Matcher<Object> value)Matches intent with given extra final UnithasExtraWithKey(String key)Matches intent with given extra key final UnithasExtraWithKey(Matcher<String> key)Matches intent with given extra key final UnithasExtras(Matcher<Bundle> extras)Matches intent with given extras final UnithasExtras(Function1<BundleBuilder, Unit> function)Matches intent with given extras final UnithasFlag(Integer flag)Matches intent with given flag final UnithasFlags(Integer flags)Matches intent with given flags final UnithasFlags(Integer flags)Matches intent with given flags final UnithasType(String type)Matches intent with given type final UnithasType(Matcher<String> type)Matches intent with given type final UnithasPackage(String packageName)Matches intent with given package final UnithasPackage(Matcher<String> packageName)Matches intent with given package final UnittoPackage(String packageName)Matches intent which addresses to given package final UnitisInternal()Matches any internal intent final UnitwithResult(Function1<ActivityResultBuilder, Unit> function)Invoke this function if you want to set default result for intending intents final Matcher<Intent>getMatcher()final Instrumentation.ActivityResultgetResult()-
-
Method Detail
-
hasAction
final Unit hasAction(String action)
Matches intent with given action
- Parameters:
action- Action to be matched
-
hasAction
final Unit hasAction(Matcher<String> action)
Matches intent with given action
- Parameters:
action- Matcher for action string
-
hasCategories
final Unit hasCategories(String categories)
Matches intent with given categories
- Parameters:
categories- Categories to be matched
-
hasCategories
final Unit hasCategories(Matcher<out Iterable<String>> categories)
Matches intent with given categories
- Parameters:
categories- Matcher for categories list
-
hasComponent
final Unit hasComponent(String className)
Matches intent which component has given class name
- Parameters:
className- Class name to be matched in intent's component
-
hasComponent
final Unit hasComponent(ComponentName component)
Matches intent with given component
- Parameters:
component- Component name to be matched
-
hasComponent
final Unit hasComponent(Matcher<ComponentName> component)
Matches intent with given component
- Parameters:
component- Matcher for component name
-
hasComponent
final Unit hasComponent(Function1<ComponentNameBuilder, Unit> function)
Matches intent with given component
- Parameters:
function- Builder for a component to match
-
hasData
final Unit hasData(String uri)
Matches intent with given data
- Parameters:
uri- Uri to be matched
-
hasData
final Unit hasData(Uri uri)
Matches intent with given data
- Parameters:
uri- Uri to be matched
-
hasData
final Unit hasData(Matcher<Uri> uri)
Matches intent with given data
- Parameters:
uri- Matcher for the uri
-
hasData
final Unit hasData(Function1<UriBuilder, Unit> function)
Matches intent with given data
- Parameters:
function- Builder for a uri to match
-
hasExtra
final Unit hasExtra(String key, Object value)
Matches intent with given extra
- Parameters:
key- Extra keyvalue- Extra value
-
hasExtra
final Unit hasExtra(Matcher<String> key, Matcher<Object> value)
Matches intent with given extra
- Parameters:
key- Matcher for extra keyvalue- Matcher for extra value
-
hasExtraWithKey
final Unit hasExtraWithKey(String key)
Matches intent with given extra key
- Parameters:
key- Extra key
-
hasExtraWithKey
final Unit hasExtraWithKey(Matcher<String> key)
Matches intent with given extra key
- Parameters:
key- Matcher for extra key
-
hasExtras
final Unit hasExtras(Matcher<Bundle> extras)
Matches intent with given extras
- Parameters:
extras- Matched for extras bundle
-
hasExtras
final Unit hasExtras(Function1<BundleBuilder, Unit> function)
Matches intent with given extras
- Parameters:
function- Builder for a bundle to match
-
hasFlag
final Unit hasFlag(Integer flag)
Matches intent with given flag
- Parameters:
flag- Flag to be matched
-
hasFlags
final Unit hasFlags(Integer flags)
Matches intent with given flags
- Parameters:
flags- Flags to be matched
-
hasFlags
final Unit hasFlags(Integer flags)
Matches intent with given flags
- Parameters:
flags- Flags to be matched
-
hasType
final Unit hasType(String type)
Matches intent with given type
- Parameters:
type- Type to match
-
hasType
final Unit hasType(Matcher<String> type)
Matches intent with given type
- Parameters:
type- Matcher for type
-
hasPackage
final Unit hasPackage(String packageName)
Matches intent with given package
- Parameters:
packageName- Package name to match
-
hasPackage
final Unit hasPackage(Matcher<String> packageName)
Matches intent with given package
- Parameters:
packageName- Matcher for a package name
-
toPackage
final Unit toPackage(String packageName)
Matches intent which addresses to given package
- Parameters:
packageName- Package name to match
-
isInternal
final Unit isInternal()
Matches any internal intent
-
withResult
final Unit withResult(Function1<ActivityResultBuilder, Unit> function)
Invoke this function if you want to set default result for intending intents
- Parameters:
function- Builder for activity result
-
getMatcher
final Matcher<Intent> getMatcher()
-
getResult
final Instrumentation.ActivityResult getResult()
-
-
-
-