### Question:
CustomerRepository { @HystrixCommand(commandKey = "Customers", fallbackMethod = "getFallbackCustomer", commandProperties = { @HystrixProperty(name = "execution.isolation.thread.timeoutInMilliseconds", value = "1000") }) public Customer getCustomerById(Long id) { Span span = tracer.buildSpan("getCustomerById").start(); log.debug("Entering OrdersService.getCustomerById()"); UriComponentsBuilder builder = UriComponentsBuilder .fromHttpUrl(customersServiceURL) .pathSegment( "{customer}"); Customer c = restTemplate.getForObject( builder.buildAndExpand(id).toUriString(), Customer.class); if (c == null) { throw new RuntimeException(); } log.debug(c.toString()); span.finish(); return c; }  @HystrixCommand(commandKey = "Customers", fallbackMethod = "getFallbackCustomer", commandProperties = { @HystrixProperty(name = "execution.isolation.thread.timeoutInMilliseconds", value = "1000") }) Customer getCustomerById(Long id); Customer getFallbackCustomer(Long id, Throwable e);  }### Answer:
@Test public void getCustomerByIdExistingTest() { Mockito.when(restTemplate.getForObject("http: .thenReturn((Customer)SerializationUtils.clone(customer)); Customer found = repository.getCustomerById(new Long(1)); assertThat(found).isEqualTo(customer); }
@Test(expected = RuntimeException.class) public void getCustomerByIdNonExistingTest() { Mockito.when(restTemplate.getForObject("http: .thenReturn(null); repository.getCustomerById(new Long(1)); }