@Test public void requestLocationUpdatesShouldDefaultCallToHighAccuracy() { LocationListener locationListener = Mockito.mock(LocationListener.class); ArgumentCaptor<LocationRequest> locationRequestCaptor = ArgumentCaptor.forClass(LocationRequest.class); Mockito.doNothing().when(googleLocationClient).requestLocationUpdates(Mockito.eq(locationListener), Mockito.any(LocationRequest.class)); googleLocationClient.requestLocationUpdates(locationListener); Mockito.verify(googleLocationClient, Mockito.times(1)) .requestLocationUpdates(Mockito.eq(locationListener), locationRequestCaptor.capture()); Assert.assertEquals(LocationRequest.PRIORITY_HIGH_ACCURACY, locationRequestCaptor.getValue().getPriority()); }
@Override public void requestLocationUpdates(@NonNull android.location.LocationListener locationListener) { LocationRequest locationRequest = new LocationRequest(); locationRequest.setInterval(updateInterval); locationRequest.setFastestInterval(fastestUpdateInterval); locationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY); requestLocationUpdates(locationListener, locationRequest); }
GoogleLocationClient extends BaseLocationClient implements LocationListener { @Override public void requestLocationUpdates(@NonNull android.location.LocationListener locationListener) { LocationRequest locationRequest = new LocationRequest(); locationRequest.setInterval(updateInterval); locationRequest.setFastestInterval(fastestUpdateInterval); locationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY); requestLocationUpdates(locationListener, locationRequest); } }
GoogleLocationClient extends BaseLocationClient implements LocationListener { @Override public void requestLocationUpdates(@NonNull android.location.LocationListener locationListener) { LocationRequest locationRequest = new LocationRequest(); locationRequest.setInterval(updateInterval); locationRequest.setFastestInterval(fastestUpdateInterval); locationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY); requestLocationUpdates(locationListener, locationRequest); } GoogleLocationClient(@NonNull Context context); }
GoogleLocationClient extends BaseLocationClient implements LocationListener { @Override public void requestLocationUpdates(@NonNull android.location.LocationListener locationListener) { LocationRequest locationRequest = new LocationRequest(); locationRequest.setInterval(updateInterval); locationRequest.setFastestInterval(fastestUpdateInterval); locationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY); requestLocationUpdates(locationListener, locationRequest); } GoogleLocationClient(@NonNull Context context); @Override void stopLocationUpdates(); @Override @Nullable Location getLastLocation(); @Override void onLocationChanged(Location location); @Override void requestLocationUpdates(@NonNull android.location.LocationListener locationListener); void requestLocationUpdates(@NonNull android.location.LocationListener locationListener
            , @NonNull LocationRequest locationRequest); @Override void setUpdateIntervals(long updateInterval, long fastestUpdateInterval); @NonNull @Override String getProvider(); @Override boolean isProviderEnabled(); @Override void close(); FusedLocationProviderClient getFusedLocationClient(); }
GoogleLocationClient extends BaseLocationClient implements LocationListener { @Override public void requestLocationUpdates(@NonNull android.location.LocationListener locationListener) { LocationRequest locationRequest = new LocationRequest(); locationRequest.setInterval(updateInterval); locationRequest.setFastestInterval(fastestUpdateInterval); locationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY); requestLocationUpdates(locationListener, locationRequest); } GoogleLocationClient(@NonNull Context context); @Override void stopLocationUpdates(); @Override @Nullable Location getLastLocation(); @Override void onLocationChanged(Location location); @Override void requestLocationUpdates(@NonNull android.location.LocationListener locationListener); void requestLocationUpdates(@NonNull android.location.LocationListener locationListener
            , @NonNull LocationRequest locationRequest); @Override void setUpdateIntervals(long updateInterval, long fastestUpdateInterval); @NonNull @Override String getProvider(); @Override boolean isProviderEnabled(); @Override void close(); FusedLocationProviderClient getFusedLocationClient();  }