@Test public void shouldCallShowRationale() { when(permissionAction.hasSelfPermission(READ_CONTACTS)).thenReturn(false); when(permissionAction.shouldShowRequestPermissionRationale(READ_CONTACTS)).thenReturn(true); permissionPresenter.requestReadContactsPermission(); verify(permissionCallbacks).showRationale(Action.ACTION_CODE_READ_CONTACTS); }
public void requestReadContactsPermission() { checkAndRequestPermission(Action.READ_CONTACTS); }
PermissionPresenter { public void requestReadContactsPermission() { checkAndRequestPermission(Action.READ_CONTACTS); } }
PermissionPresenter { public void requestReadContactsPermission() { checkAndRequestPermission(Action.READ_CONTACTS); } PermissionPresenter(PermissionAction permissionAction, PermissionCallbacks permissionCallbacks); }
PermissionPresenter { public void requestReadContactsPermission() { checkAndRequestPermission(Action.READ_CONTACTS); } PermissionPresenter(PermissionAction permissionAction, PermissionCallbacks permissionCallbacks); void requestReadContactsPermission(); void requestReadContactsPermissionAfterRationale(); void requestWriteExternalStorangePermission(); void requestWriteExternalStorangePermissionAfterRationale(); void requestSendSMS(); void requestSendSMSAfterRationale(); void checkGrantedPermission(int[] grantResults, int requestCode); }
PermissionPresenter { public void requestReadContactsPermission() { checkAndRequestPermission(Action.READ_CONTACTS); } PermissionPresenter(PermissionAction permissionAction, PermissionCallbacks permissionCallbacks); void requestReadContactsPermission(); void requestReadContactsPermissionAfterRationale(); void requestWriteExternalStorangePermission(); void requestWriteExternalStorangePermissionAfterRationale(); void requestSendSMS(); void requestSendSMSAfterRationale(); void checkGrantedPermission(int[] grantResults, int requestCode);  }