### Question:
CancelServiceImpl implements CancelService { public boolean sendEmail(NotifyInfo notifyInfo, HttpHeaders headers) { CancelServiceImpl.LOGGER.info("[Cancel Order Service][Send Email]"); HttpEntity requestEntity = new HttpEntity(notifyInfo, headers); ResponseEntity<Boolean> re = restTemplate.exchange( "http: HttpMethod.POST, requestEntity, Boolean.class); return re.getBody(); }  @Override Response cancelOrder(String orderId, String loginId, HttpHeaders headers); boolean sendEmail(NotifyInfo notifyInfo, HttpHeaders headers); @Override Response calculateRefund(String orderId, HttpHeaders headers); boolean drawbackMoney(String money, String userId, HttpHeaders headers); Response<User> getAccount(String orderId, HttpHeaders headers);  }### Answer:
@Test public void testSendEmail() { NotifyInfo notifyInfo = new NotifyInfo(); HttpEntity requestEntity2 = new HttpEntity(notifyInfo, headers); ResponseEntity<Boolean> re = new ResponseEntity<>(true, HttpStatus.OK); Mockito.when(restTemplate.exchange( "http: HttpMethod.POST, requestEntity2, Boolean.class)).thenReturn(re); Boolean result = cancelServiceImpl.sendEmail(notifyInfo, headers); Assert.assertTrue(result); }