### Question:
LoadBalanceController { @RequestMapping(value = "/{id}", method = RequestMethod.GET) public BalancingDTO detailLoadBalance(@PathVariable String id, @PathVariable String env) throws ParamValidationException { id = id.replace(Constants.ANY_VALUE, Constants.PATH_SEPARATOR); BalancingDTO balancingDTO = overrideService.findBalance(id); if (balancingDTO == null) { throw new ResourceNotFoundException("Unknown ID!"); } return balancingDTO; } @Autowired  LoadBalanceController(OverrideService overrideService, ProviderService providerService); @RequestMapping(method = RequestMethod.POST) @ResponseStatus(HttpStatus.CREATED) boolean createLoadbalance(@RequestBody BalancingDTO balancingDTO, @PathVariable String env); @RequestMapping(value = "/{id}", method = RequestMethod.PUT) boolean updateLoadbalance(@PathVariable String id, @RequestBody BalancingDTO balancingDTO, @PathVariable String env); @RequestMapping(method = RequestMethod.GET) List<BalancingDTO> searchLoadbalances(@RequestParam(required = false) String service,
                                                 @RequestParam(required = false) String application,
                                                 @PathVariable String env); @RequestMapping(value = "/{id}", method = RequestMethod.GET) BalancingDTO detailLoadBalance(@PathVariable String id, @PathVariable String env); @RequestMapping(value = "/{id}", method = RequestMethod.DELETE) boolean deleteLoadBalance(@PathVariable String id, @PathVariable String env);  }### Answer:
@Test public void detailLoadBalance() throws IOException { String id = "1"; ResponseEntity<String> response; response = restTemplate.getForEntity(url("/api/{env}/rules/balancing/{id}"), String.class, env, id); assertFalse("should return a fail response, when id is null", (Boolean) objectMapper.readValue(response.getBody(), Map.class).get("success")); BalancingDTO balancingDTO = new BalancingDTO(); when(overrideService.findBalance(id)).thenReturn(balancingDTO); response = restTemplate.getForEntity(url("/api/{env}/rules/balancing/{id}"), String.class, env, id); assertEquals(HttpStatus.OK, response.getStatusCode()); }