@Test public void testPermission_whenPermissionIsNotGranted_thenShouldntReturnLocation() throws Exception { RootRequest rootRequest = TestObjects.permissionGrantedLocationRequest(false); PermissionRequestHandler permissionRequestHandler = new PermissionRequestHandler(rootRequest) { @Override public RootResponse getResponse() { return new RootResponse(); } }; assertNull(permissionRequestHandler.getLocation()); }
@Nullable public Location getLocation() { if (isPermissionGranted()) { return getRootRequest().device.location; } else { return null; } }
PermissionRequestHandler extends RequestHandler { @Nullable public Location getLocation() { if (isPermissionGranted()) { return getRootRequest().device.location; } else { return null; } } }
PermissionRequestHandler extends RequestHandler { @Nullable public Location getLocation() { if (isPermissionGranted()) { return getRootRequest().device.location; } else { return null; } } protected  PermissionRequestHandler(RootRequest rootRequest); }
PermissionRequestHandler extends RequestHandler { @Nullable public Location getLocation() { if (isPermissionGranted()) { return getRootRequest().device.location; } else { return null; } } protected  PermissionRequestHandler(RootRequest rootRequest); boolean isPermissionGranted(); @Nullable UserProfile getUserProfile(); @Nullable Location getLocation(); }
PermissionRequestHandler extends RequestHandler { @Nullable public Location getLocation() { if (isPermissionGranted()) { return getRootRequest().device.location; } else { return null; } } protected  PermissionRequestHandler(RootRequest rootRequest); boolean isPermissionGranted(); @Nullable UserProfile getUserProfile(); @Nullable Location getLocation();  }