GraphHopperRouter implements Router, DistanceCalculator, Region { @Override public BoundingBox getBounds() { BBox bounds = graphHopper.getGraphHopperStorage().getBounds(); return new BoundingBox( Coordinates.valueOf(bounds.minLat, bounds.minLon), Coordinates.valueOf(bounds.maxLat, bounds.maxLon)); } @Autowired  GraphHopperRouter(GraphHopperOSM graphHopper); @Override List<Coordinates> getPath(Coordinates from, Coordinates to); @Override long travelTimeMillis(Coordinates from, Coordinates to); @Override BoundingBox getBounds();  }
@Test void should_return_graphHopper_bounds() { when(graphHopper.getGraphHopperStorage()).thenReturn(graphHopperStorage); double minLat_Y = -90; double minLon_X = -180; double maxLat_Y = 90; double maxLon_X = 180; BBox bbox = new BBox(minLon_X, maxLon_X, minLat_Y, maxLat_Y); when(graphHopperStorage.getBounds()).thenReturn(bbox); BoundingBox boundingBox = new GraphHopperRouter(graphHopper).getBounds(); assertThat(boundingBox.getSouthWest()).isEqualTo(Coordinates.valueOf(minLat_Y, minLon_X)); assertThat(boundingBox.getNorthEast()).isEqualTo(Coordinates.valueOf(maxLat_Y, maxLon_X)); }