### Question:
AccessesController { @RequestMapping(value = "/{id}", method = RequestMethod.GET) public AccessDTO detailAccess(@PathVariable String id, @PathVariable String env) { id = id.replace(Constants.ANY_VALUE, Constants.PATH_SEPARATOR); AccessDTO accessDTO = routeService.findAccess(id); return accessDTO; } @Autowired  AccessesController(RouteService routeService, ProviderService providerService); @RequestMapping(method = RequestMethod.GET) List<AccessDTO> searchAccess(@RequestParam(required = false) String service,
                                        @RequestParam(required = false) String application,
                                        @PathVariable String env); @RequestMapping(value = "/{id}", method = RequestMethod.GET) AccessDTO detailAccess(@PathVariable String id, @PathVariable String env); @RequestMapping(value = "/{id}", method = RequestMethod.DELETE) void deleteAccess(@PathVariable String id, @PathVariable String env); @RequestMapping(method = RequestMethod.POST) @ResponseStatus(HttpStatus.CREATED) void createAccess(@RequestBody AccessDTO accessDTO, @PathVariable String env); @RequestMapping(value = "/{id}", method = RequestMethod.PUT) void updateAccess(@PathVariable String id, @RequestBody AccessDTO accessDTO, @PathVariable String env);  }### Answer:
@Test public void detailAccess() throws JsonProcessingException { String id = "1"; AccessDTO accessDTO = new AccessDTO(); when(routeService.findAccess(id)).thenReturn(accessDTO); ResponseEntity<String> response = restTemplate.getForEntity(url("/api/{env}/rules/access/{id}"), String.class, env, id); String exceptResponseBody = objectMapper.writeValueAsString(accessDTO); assertEquals(exceptResponseBody, response.getBody()); }