### Question:
OrderRepository { @HystrixCommand(commandKey = "Orders", fallbackMethod = "getFallbackOrder", commandProperties = { @HystrixProperty(name = "execution.isolation.thread.timeoutInMilliseconds", value = "1000") }) public Order getOrderById(Long id) { Span span = tracer.buildSpan("getOrderById").start(); log.debug("Entering OrderRepository.getOrderById()"); UriComponentsBuilder builder = UriComponentsBuilder .fromHttpUrl(ordersServiceURL) .pathSegment( "{order}"); Order o = restTemplate.getForObject( builder.buildAndExpand(id).toUriString(), Order.class); if (o == null) log.debug("Obtained null order"); else log.debug(o.toString()); span.finish(); return o; }  @HystrixCommand(commandKey = "Orders", fallbackMethod = "getFallbackOrder", commandProperties = { @HystrixProperty(name = "execution.isolation.thread.timeoutInMilliseconds", value = "1000") }) Order getOrderById(Long id); Order getFallbackOrder(Long id, Throwable e);  }### Answer:
@Test public void getOrderByIdExistingTest() { Mockito.when(restTemplate.getForObject("http: .thenReturn((Order)SerializationUtils.clone(order)); Order found = repository.getOrderById(new Long(1)); assertThat(found).isEqualTo(order); }
@Test public void getOrderByIdNonExistingTest() { Mockito.when(restTemplate.getForObject("http: .thenReturn(null); Order found = repository.getOrderById(new Long(1)); assertThat(found).isNull(); }