TagRestController { @RequestMapping(value = TAGS_URI_PREFIX + "/tagTypes/{tagTypeCode}/tagCodes/{tagCode}", method = RequestMethod.DELETE) @Secured(SecurityFunctions.FN_TAGS_DELETE) public Tag deleteTag(@PathVariable("tagTypeCode") String tagTypeCode, @PathVariable("tagCode") String tagCode) { TagKey tagKey = new TagKey(tagTypeCode, tagCode); return tagService.deleteTag(tagKey); }  @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 testDeleteTag() { TagKey tagKey = new TagKey(TAG_TYPE, TAG_CODE); Tag tag = getNewTag(tagKey); when(tagService.deleteTag(tagKey)).thenReturn(tag); Tag deletedTag = tagRestController.deleteTag(TAG_TYPE, TAG_CODE); verify(tagService).deleteTag(tagKey); verifyNoMoreInteractions(tagService); assertEquals(tag, deletedTag); }