### Question:
RepositoryPermissionsJaxrsService { @PUT @Path("/{uri:.+}") @Consumes({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) public Response updatePermission(RepositoryPermission permission, @Context UriInfo uriInfo) throws ErrorDescriptorException { PermissionComplexKey permissionComplexKey = new PermissionComplexKey(uriInfo).invoke(); permission.setUri(permissionComplexKey.getResourceUri()); permission.setRecipient(permissionComplexKey.getRecipientUri()); service.putPermission(converter.toServer(permission, null)); return Response.ok().entity(permission).build(); }  @GET @Path("/{uri:.+}") @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) Response getPermissionsEntryPoint(@Context UriInfo uriInfo); @GET @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) Response getPermissionsEntryPointRoot(@Context UriInfo uriInfo); @POST @Consumes({"application/collection+xml", "application/collection+json"}) @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) Response createPermissions(RepositoryPermissionListWrapper data); @DELETE @Path("/{uri:.+}") Response deletePermissionsEntryPoint(@Context UriInfo uriInfo); @DELETE Response deletePermissionsEntryPointRoot(@Context UriInfo uriInfo); @PUT @Path("/{uri:.+}") @Consumes({"application/collection+xml", "application/collection+json"}) @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) Response updatePermissions(RepositoryPermissionListWrapper data,
            @PathParam("uri") String resourceUri); @PUT @Consumes({"application/collection+xml", "application/collection+json"}) @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) Response updatePermissionsRoot(RepositoryPermissionListWrapper data); @PUT @Path("/{uri:.+}") @Consumes({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) Response updatePermission(RepositoryPermission permission,
            @Context UriInfo uriInfo); @PUT @Consumes({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) Response updatePermissionRoot(RepositoryPermission permission,
            @Context UriInfo uriInfo); @POST @Consumes({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) Response createPermission(RepositoryPermission permission);  }### Answer:
@Test(groups = {"updatePermission"}) public void testUpdatePermission() throws Exception { when(permissionsService.getPermission("/public", userIdentity.getRecipientClass(), userIdentity.getId())).thenReturn(serverPermission); UriInfo info = new UriInfoImpl("permissions/public;recipient=user:/me"); Response response = service.updatePermission(clientPermission, info); assertNotNull(response); assertEquals(response.getStatus(), Response.Status.OK.getStatusCode()); RepositoryPermission entity = (RepositoryPermission)response.getEntity(); assertEquals(entity, clientPermission); verify(permissionsService).putPermission(serverPermission); }