### Question:
PreserveOtherServiceImpl implements PreserveOtherService { public Ticket dipatchSeat(Date date, String tripId, String startStationId, String endStataionId, int seatType, HttpHeaders httpHeaders) { Seat seatRequest = new Seat(); seatRequest.setTravelDate(date); seatRequest.setTrainNumber(tripId); seatRequest.setStartStation(startStationId); seatRequest.setSeatType(seatType); seatRequest.setDestStation(endStataionId); HttpEntity requestEntityTicket = new HttpEntity(seatRequest, httpHeaders); ResponseEntity<Response<Ticket>> reTicket = restTemplate.exchange( "http: HttpMethod.POST, requestEntityTicket, new ParameterizedTypeReference<Response<Ticket>>() { }); return reTicket.getBody().getData(); }  @Override Response preserve(OrderTicketsInfo oti, HttpHeaders httpHeaders); Ticket dipatchSeat(Date date, String tripId, String startStationId, String endStataionId, int seatType, HttpHeaders httpHeaders); boolean sendEmail(NotifyInfo notifyInfo, HttpHeaders httpHeaders); User getAccount(String accountId, HttpHeaders httpHeaders);  }### Answer:
@Test public void testDipatchSeat() { long mills = System.currentTimeMillis(); Seat seatRequest = new Seat(new Date(mills), "G1234", "start_station", "dest_station", 2); HttpEntity requestEntityTicket = new HttpEntity<>(seatRequest, headers); Response<Ticket> response = new Response<>(); ResponseEntity<Response<Ticket>> reTicket = new ResponseEntity<>(response, HttpStatus.OK); Mockito.when(restTemplate.exchange( "http: HttpMethod.POST, requestEntityTicket, new ParameterizedTypeReference<Response<Ticket>>() { })).thenReturn(reTicket); Ticket result = preserveOtherServiceImpl.dipatchSeat(new Date(mills), "G1234", "start_station", "dest_station", 2, headers); Assert.assertNull(result); }