test: cover rental-service and fm-gateway low-coverage classes - #19
Open
devin-ai-integration[bot] wants to merge 1 commit into
Open
test: cover rental-service and fm-gateway low-coverage classes#19devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Test-only change. I measured JaCoCo line coverage per module (ignoring generated protobuf/gRPC/JAXB classes) and the two weak spots were
rental-service(51.4%) andfm-gateway(71.9%);stations-service(87.1%) and the battery/tracking handwritten code (~89%) were already covered. This adds unit tests for the untested classes in those two modules:rental-service, new tests for previously untested classes:
AuthService,AuthSessionService,AuthController,ProcessExceptionHandler,ProcessSessionService,CamundaProcessInspector,CamundaMessageCorrelator,CamundaProcessVariablesWriter,BankClient,BankWorker,RentalWorker,VehicleWorker,NotificationWorker,ProcessSessionWorker,ProcessSession, plus the branch-heavyRentalServiceoperations (scanQr/bookByType/undoBooking/getBooking/getMapStations) and the remainingRentalControllerendpoints (RentalService20% → 97.8%,RentalController16.7% → 100%).fm-gateway:
GraphHopperClient(10.5% → 86.8%), theFleetSimulatorscheduled tick (initial 15s park, step advance, arrival, per-vehicle error isolation, gRPC failures),SimulationStateandVehicleRoute.Two things worth knowing about how the tests reach the collaborators:
CamundaProcessInspector,CamundaMessageCorrelator) andGraphHopperClientbuild their ownRestClientfrom a base URL, so instead of mocking the client the tests point them at a JDKHttpServerbound to an ephemeral port and assert on the real request/response handling — including retry, 404/500 and connection-refused paths.ReflectionTestUtilsrather than sleeping, e.g. the simulator tick tests move a state's private start instant into the past:No production code was touched. Frontend (Angular) tests were left as-is:
ng testonmainalready fails 2 of 47 specs (rideCompletionGuarddirect-URL redirect, andActiveRideComponenttransient summary) — pre-existing failures unrelated to this change.Link to Devin session: https://app.devin.ai/sessions/ff9b031943194070bd76b738071dd2fe
Requested by: @NicolasCola7