RuntimePermissionsStubber.Matchers


class RuntimePermissionsStubber.Matchers


A collection of hamcrest matchers to help with runtime permission stubbing.

Usually you will not need to use these matchers directly and purely rely on: intendingGrantedPermissions or intendingRevokedPermissions

Summary

Constants

const String!
ACTION_REQUEST_PERMISSIONS = "android.content.pm.action.REQUEST_PERMISSIONS"

Internal Android intent action which is used to request runtime permissions.

Public constructors

Public functions

java-static Matcher<Intent>!

Matches any runtime permission Intent.

java-static Matcher<Intent>!
hasPermission(permission: String!)

Matches runtime permission Intents for a particular permission.

java-static Matcher<Intent>!
hasPermissions(permissions: Array<String!>!)

Matches runtime permission Intents for a list of permissions.

java-static Matcher<Intent>!
hasPermissions(permissionsMatcher: Matcher<Iterable<String>>!)

Matches runtime permission Intents for a list of permissions.

Constants

ACTION_REQUEST_PERMISSIONS

const val ACTION_REQUEST_PERMISSIONS = "android.content.pm.action.REQUEST_PERMISSIONS": String!

Internal Android intent action which is used to request runtime permissions.

Public constructors

Matchers

Matchers()

Public functions

anyPermission

java-static fun anyPermission(): Matcher<Intent>!

Matches any runtime permission Intent.

hasPermission

java-static fun hasPermission(permission: String!): Matcher<Intent>!

Matches runtime permission Intents for a particular permission.

hasPermissions

java-static fun hasPermissions(permissions: Array<String!>!): Matcher<Intent>!

Matches runtime permission Intents for a list of permissions.

hasPermissions

java-static fun hasPermissions(permissionsMatcher: Matcher<Iterable<String>>!): Matcher<Intent>!

Matches runtime permission Intents for a list of permissions.

Parameters
permissionsMatcher: Matcher<Iterable<String>>!

that matches a permission string