@Test public void testFromToDepartureCar() { when(this.directionsApiCalls.fromToWithDepartureTime("A", "B", TravelMode.DRIVING, new DateTime(0))) .thenReturn(this.data.carRoutes); BestTransportResult result = this.logic.fromToWithDeparture("A", "B", TravelMode.DRIVING, new DateTime(0)); verify(this.directionsApiCalls).fromToWithDepartureTime("A", "B", TravelMode.DRIVING, new DateTime(0)); assertThat(result.getRoute(), equalTo(this.data.carRoutes[4])); assertThat(result.getMode(), equalTo(TravelMode.DRIVING)); }
public BestTransportResult fromToWithDeparture(String origin, String destination, TravelMode mode, ReadableInstant departureTime) { DirectionsRoute[] routes = this.calls.fromToWithDepartureTime(origin, destination, mode, departureTime); if (mode == TravelMode.TRANSIT) { return new BestTransportResult(mode, findBestArrivalTime(routes)); } return new BestTransportResult(mode, findBestRoute(routes)); }
DirectionApiLogic { public BestTransportResult fromToWithDeparture(String origin, String destination, TravelMode mode, ReadableInstant departureTime) { DirectionsRoute[] routes = this.calls.fromToWithDepartureTime(origin, destination, mode, departureTime); if (mode == TravelMode.TRANSIT) { return new BestTransportResult(mode, findBestArrivalTime(routes)); } return new BestTransportResult(mode, findBestRoute(routes)); } }
DirectionApiLogic { public BestTransportResult fromToWithDeparture(String origin, String destination, TravelMode mode, ReadableInstant departureTime) { DirectionsRoute[] routes = this.calls.fromToWithDepartureTime(origin, destination, mode, departureTime); if (mode == TravelMode.TRANSIT) { return new BestTransportResult(mode, findBestArrivalTime(routes)); } return new BestTransportResult(mode, findBestRoute(routes)); }  }
DirectionApiLogic { public BestTransportResult fromToWithDeparture(String origin, String destination, TravelMode mode, ReadableInstant departureTime) { DirectionsRoute[] routes = this.calls.fromToWithDepartureTime(origin, destination, mode, departureTime); if (mode == TravelMode.TRANSIT) { return new BestTransportResult(mode, findBestArrivalTime(routes)); } return new BestTransportResult(mode, findBestRoute(routes)); }  BestTransportResult fromTo(String origin, String destination, TravelMode mode); BestTransportResult fromToWithDeparture(String origin, String destination, TravelMode mode,
			ReadableInstant departureTime); ReadableInstant whenIHaveToGo(String origin, String destination, TravelMode mode, DateTime arrivalTime); BestTransportResult getBestTransportInTime(String origin, String destination,
			ReadableInstant departureTime); TravelMode getTravelMode(String mode); }
DirectionApiLogic { public BestTransportResult fromToWithDeparture(String origin, String destination, TravelMode mode, ReadableInstant departureTime) { DirectionsRoute[] routes = this.calls.fromToWithDepartureTime(origin, destination, mode, departureTime); if (mode == TravelMode.TRANSIT) { return new BestTransportResult(mode, findBestArrivalTime(routes)); } return new BestTransportResult(mode, findBestRoute(routes)); }  BestTransportResult fromTo(String origin, String destination, TravelMode mode); BestTransportResult fromToWithDeparture(String origin, String destination, TravelMode mode,
			ReadableInstant departureTime); ReadableInstant whenIHaveToGo(String origin, String destination, TravelMode mode, DateTime arrivalTime); BestTransportResult getBestTransportInTime(String origin, String destination,
			ReadableInstant departureTime); TravelMode getTravelMode(String mode);  }