### Question:
PreserveServiceImpl implements PreserveService { public boolean sendEmail(NotifyInfo notifyInfo, HttpHeaders httpHeaders) { PreserveServiceImpl.LOGGER.info("[Preserve Service][Send Email]"); HttpEntity requestEntitySendEmail = new HttpEntity(notifyInfo, httpHeaders); ResponseEntity<Boolean> reSendEmail = restTemplate.exchange( "http: HttpMethod.POST, requestEntitySendEmail, Boolean.class); return reSendEmail.getBody(); }  @Override Response preserve(OrderTicketsInfo oti, HttpHeaders headers); 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 testSendEmail() { NotifyInfo notifyInfo = new NotifyInfo(); HttpEntity requestEntitySendEmail = new HttpEntity(notifyInfo, headers); ResponseEntity<Boolean> reSendEmail = new ResponseEntity<>(true, HttpStatus.OK); Mockito.when(restTemplate.exchange( "http: HttpMethod.POST, requestEntitySendEmail, Boolean.class)).thenReturn(reSendEmail); boolean result = preserveServiceImpl.sendEmail(notifyInfo, headers); Assert.assertTrue(result); }