fix: null in unit testing

This commit is contained in:
js0ny 2025-12-06 11:25:23 +00:00
parent b8fd649ccf
commit 9e2b38e205
2 changed files with 19 additions and 3 deletions

View file

@ -63,7 +63,7 @@ public class PathFinderService {
private final Map<Integer, LngLat> servicePointLocations;
private final List<Region> restrictedRegions;
@Autowired
@Autowired(required = false)
private TelemetryService telemetryService;
/**
@ -182,7 +182,9 @@ public class PathFinderService {
var resp = new DeliveryPathResponse(totalCost, totalMoves, paths.toArray(new DronePath[0]));
telemetryService.sendEventAsyncByPathResponse(resp, deliveryTimestamps);
if (telemetryService != null) {
telemetryService.sendEventAsyncByPathResponse(resp, deliveryTimestamps);
}
return resp;
}