@Test public void testFromToTransit() { when(this.directionsApiCalls.fromTo("A", "B", TravelMode.TRANSIT)).thenReturn(this.data.transportRoutes); BestTransportResult result = this.logic.fromTo("A", "B", TravelMode.TRANSIT); verify(this.directionsApiCalls).fromTo("A", "B", TravelMode.TRANSIT); assertThat(result.getRoute(), equalTo(this.data.transportRoutes[6])); assertThat(result.getMode(), equalTo(TravelMode.TRANSIT)); }
public BestTransportResult fromTo(String origin, String destination, TravelMode mode) { DirectionsRoute[] routes = this.calls.fromTo(origin, destination, mode); if (mode == TravelMode.TRANSIT) { return new BestTransportResult(mode, findBestArrivalTime(routes)); } return new BestTransportResult(mode, findBestRoute(routes)); }
DirectionApiLogic { public BestTransportResult fromTo(String origin, String destination, TravelMode mode) { DirectionsRoute[] routes = this.calls.fromTo(origin, destination, mode); if (mode == TravelMode.TRANSIT) { return new BestTransportResult(mode, findBestArrivalTime(routes)); } return new BestTransportResult(mode, findBestRoute(routes)); } }
DirectionApiLogic { public BestTransportResult fromTo(String origin, String destination, TravelMode mode) { DirectionsRoute[] routes = this.calls.fromTo(origin, destination, mode); if (mode == TravelMode.TRANSIT) { return new BestTransportResult(mode, findBestArrivalTime(routes)); } return new BestTransportResult(mode, findBestRoute(routes)); }  }
DirectionApiLogic { public BestTransportResult fromTo(String origin, String destination, TravelMode mode) { DirectionsRoute[] routes = this.calls.fromTo(origin, destination, mode); 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 fromTo(String origin, String destination, TravelMode mode) { DirectionsRoute[] routes = this.calls.fromTo(origin, destination, mode); 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);  }