### Question:
AdminOrderServiceImpl implements AdminOrderService { @Override public Response updateOrder(Order request, HttpHeaders headers) { Response updateOrderResult; LOGGER.info("UPDATE ORDER INFO : " + request.toString()); if (request.getTrainNumber().startsWith("G") || request.getTrainNumber().startsWith("D")) { AdminOrderServiceImpl.LOGGER.info("[Admin Order Service][Update Order]"); HttpEntity requestEntity = new HttpEntity(request, headers); ResponseEntity<Response> re = restTemplate.exchange( "http: HttpMethod.PUT, requestEntity, Response.class); updateOrderResult = re.getBody(); } else { AdminOrderServiceImpl.LOGGER.info("[Admin Order Service][Add New Order Other]"); HttpEntity requestEntity = new HttpEntity(request, headers); ResponseEntity<Response> re = restTemplate.exchange( "http: HttpMethod.PUT, requestEntity, Response.class); updateOrderResult = re.getBody(); } return updateOrderResult; }  @Override Response getAllOrders(HttpHeaders headers); @Override Response deleteOrder(String orderId, String trainNumber, HttpHeaders headers); @Override Response updateOrder(Order request, HttpHeaders headers); @Override Response addOrder(Order request, HttpHeaders headers);  }### Answer:
@Test public void testUpdateOrder1() { Order order = new Order(null, null, null, null, null, null, 0, null, "G", 0, 0, null, null, null, 0, null); HttpEntity<Order> requestEntity2 = new HttpEntity<>(order, headers); Response response = new Response(); ResponseEntity<Response> re = new ResponseEntity<>(response, HttpStatus.OK); Mockito.when(restTemplate.exchange( "http: HttpMethod.PUT, requestEntity2, Response.class)).thenReturn(re); Response result = adminOrderService.updateOrder(order, headers); Assert.assertNotNull(result); }
@Test public void testUpdateOrder2() { Order order = new Order(null, null, null, null, null, null, 0, null, "K", 0, 0, null, null, null, 0, null); HttpEntity<Order> requestEntity2 = new HttpEntity<>(order, headers); Response response = new Response(); ResponseEntity<Response> re = new ResponseEntity<>(response, HttpStatus.OK); Mockito.when(restTemplate.exchange( "http: HttpMethod.PUT, requestEntity2, Response.class)).thenReturn(re); Response result = adminOrderService.updateOrder(order, headers); Assert.assertNotNull(result); }