@Test public void testOnDestroy() { Context mockedContext = mock(Context.class, RETURNS_DEEP_STUBS); locationEngineController = new LocationEngineControllerImpl(mockedContext, locationEngine, broadcastReceiver); locationEngineController.onDestroy(); verify(mockedContext).unregisterReceiver(any(BroadcastReceiver.class)); }
@Override public void onDestroy() { removeLocationUpdates(); unregisterReceiver(); }
LocationEngineControllerImpl implements LocationEngineController { @Override public void onDestroy() { removeLocationUpdates(); unregisterReceiver(); } }
LocationEngineControllerImpl implements LocationEngineController { @Override public void onDestroy() { removeLocationUpdates(); unregisterReceiver(); } LocationEngineControllerImpl(@NonNull Context context,
                               @NonNull LocationEngine locationEngine,
                               @NonNull LocationUpdatesBroadcastReceiver locationUpdatesBroadcastReceiver); }
LocationEngineControllerImpl implements LocationEngineController { @Override public void onDestroy() { removeLocationUpdates(); unregisterReceiver(); } LocationEngineControllerImpl(@NonNull Context context,
                               @NonNull LocationEngine locationEngine,
                               @NonNull LocationUpdatesBroadcastReceiver locationUpdatesBroadcastReceiver); @Override void onPause(); @Override void onResume(); @Override void onDestroy(); }
LocationEngineControllerImpl implements LocationEngineController { @Override public void onDestroy() { removeLocationUpdates(); unregisterReceiver(); } LocationEngineControllerImpl(@NonNull Context context,
                               @NonNull LocationEngine locationEngine,
                               @NonNull LocationUpdatesBroadcastReceiver locationUpdatesBroadcastReceiver); @Override void onPause(); @Override void onResume(); @Override void onDestroy();  }