Add LocationService and GeoFirestoreRepository with Unit Tests
Overview
This pull request introduces two new classes, LocationService and GeoFirestoreRepository, along with comprehensive unit tests for each. These additions enhance the application's ability to manage real-time location updates and user position storage in Firestore. The PR includes the following changes:
Key Features
LocationService:
Manages real-time location updates with customizable distance thresholds.
Provides high-accuracy location requests with configurable intervals.
Implements callbacks for location updates and error handling.
Logs exceptions for API errors and unexpected issues.
GeoFirestoreRepository:
Handles user location updates in Firestore using GeoFirestore.
Supports location updates for authenticated users and logs unauthenticated access attempts.
Logs successful updates and errors, ensuring better traceability.
Unit Tests
Comprehensive unit tests are included for both classes:
LocationServiceTest:
Verifies onLocationUpdate callback with new location data.
Tests onError callback when location is unavailable.
Checks proper removal of location updates in stopLocationUpdates.
Handles and verifies logging for unexpected exceptions in startLocationUpdates.
GeoFirestoreRepositoryTest:
Validates warning log when user is unauthenticated.
Verifies successful location update for authenticated users.
Simulates setLocation failure and ensures error logging.
This PR brings greater flexibility and reliability to location services, ensuring efficient and secure location tracking and updating functionalities.
Add LocationService and GeoFirestoreRepository with Unit Tests
Overview
This pull request introduces two new classes,
LocationService
andGeoFirestoreRepository
, along with comprehensive unit tests for each. These additions enhance the application's ability to manage real-time location updates and user position storage in Firestore. The PR includes the following changes:Key Features
LocationService
:GeoFirestoreRepository
:Unit Tests
Comprehensive unit tests are included for both classes:
LocationServiceTest
:onLocationUpdate
callback with new location data.onError
callback when location is unavailable.stopLocationUpdates
.startLocationUpdates
.GeoFirestoreRepositoryTest
:setLocation
failure and ensures error logging.This PR brings greater flexibility and reliability to location services, ensuring efficient and secure location tracking and updating functionalities.