TagRestController { @RequestMapping(value = TAGS_URI_PREFIX + "/tagTypes/{tagTypeCode}/tagCodes/{tagCode}", method = RequestMethod.PUT, consumes = {"application/xml", "application/json"}) @Secured(SecurityFunctions.FN_TAGS_PUT) public Tag updateTag(@PathVariable("tagTypeCode") String tagTypeCode, @PathVariable("tagCode") String tagCode, @RequestBody TagUpdateRequest tagUpdateRequest) { TagKey tagKey = new TagKey(tagTypeCode, tagCode); return tagService.updateTag(tagKey, tagUpdateRequest); }  @RequestMapping(value = TAGS_URI_PREFIX, method = RequestMethod.POST, consumes = {"application/xml", "application/json"}) @Secured(SecurityFunctions.FN_TAGS_POST) Tag createTag(@RequestBody TagCreateRequest tagCreateRequest); @RequestMapping(value = TAGS_URI_PREFIX + "/tagTypes/{tagTypeCode}/tagCodes/{tagCode}", method = RequestMethod.DELETE) @Secured(SecurityFunctions.FN_TAGS_DELETE) Tag deleteTag(@PathVariable("tagTypeCode") String tagTypeCode, @PathVariable("tagCode") String tagCode); @RequestMapping(value = TAGS_URI_PREFIX + "/tagTypes/{tagTypeCode}/tagCodes/{tagCode}", method = RequestMethod.GET) @Secured(SecurityFunctions.FN_TAGS_GET) Tag getTag(@PathVariable("tagTypeCode") String tagTypeCode, @PathVariable("tagCode") String tagCode); @RequestMapping(value = TAGS_URI_PREFIX + "/tagTypes/{tagTypeCode}", method = RequestMethod.GET) @Secured(SecurityFunctions.FN_TAGS_ALL_GET) TagListResponse getTags(@PathVariable("tagTypeCode") String tagTypeCode, @RequestParam(value = "tagCode", required = false) String tagCode); @RequestMapping(value = TAGS_URI_PREFIX + "/search", method = RequestMethod.POST, consumes = {"application/xml", "application/json"}) @Secured(SecurityFunctions.FN_TAGS_SEARCH_POST) TagSearchResponse searchTags(@RequestBody TagSearchRequest request,
        @RequestParam(value = "fields", required = false, defaultValue = "") Set<String> fields); @RequestMapping(value = TAGS_URI_PREFIX + "/tagTypes/{tagTypeCode}/tagCodes/{tagCode}", method = RequestMethod.PUT, consumes = {"application/xml", "application/json"}) @Secured(SecurityFunctions.FN_TAGS_PUT) Tag updateTag(@PathVariable("tagTypeCode") String tagTypeCode, @PathVariable("tagCode") String tagCode,
        @RequestBody TagUpdateRequest tagUpdateRequest); final static String TAGS_URI_PREFIX; }
@Test public void testUpdateTag() { TagKey parentTagKey = new TagKey(TAG_TYPE, TAG_CODE); TagUpdateRequest request = new TagUpdateRequest(TAG_DISPLAY_NAME_3, TAG_SEARCH_SCORE_MULTIPLIER_3, TAG_DESCRIPTION_3, parentTagKey); TagKey tagKey = new TagKey(TAG_TYPE, TAG_CODE_2); Tag tag = getNewTag(tagKey); when(tagService.updateTag(tagKey, request)).thenReturn(tag); Tag updatedTag = tagRestController.updateTag(TAG_TYPE, TAG_CODE_2, request); verify(tagService).updateTag(tagKey, request); verifyNoMoreInteractions(tagService); assertEquals(tag, updatedTag); ; }