### Question:
AccessesController { @RequestMapping(value = "/{id}", method = RequestMethod.PUT) public void updateAccess(@PathVariable String id, @RequestBody AccessDTO accessDTO, @PathVariable String env) { id = id.replace(Constants.ANY_VALUE, Constants.PATH_SEPARATOR); ConditionRouteDTO route = routeService.findConditionRoute(id); if (Objects.isNull(route)) { throw new ResourceNotFoundException("Unknown ID!"); } routeService.updateAccess(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 updateAccess() throws IOException { AccessDTO accessDTO = new AccessDTO(); String id = "1"; restTemplate.put(url("/api/{env}/rules/access/{id}"), accessDTO, env, id); verify(routeService).findConditionRoute(id); ConditionRouteDTO conditionRouteDTO = mock(ConditionRouteDTO.class); when(routeService.findConditionRoute(id)).thenReturn(conditionRouteDTO); restTemplate.put(url("/api/{env}/rules/access/{id}"), accessDTO, env, id); verify(routeService).updateAccess(any(AccessDTO.class)); }