TagRestController { @RequestMapping(value = TAGS_URI_PREFIX + "/tagTypes/{tagTypeCode}", method = RequestMethod.GET) @Secured(SecurityFunctions.FN_TAGS_ALL_GET) public TagListResponse getTags(@PathVariable("tagTypeCode") String tagTypeCode, @RequestParam(value = "tagCode", required = false) String tagCode) { return tagService.getTags(tagTypeCode, tagCode); }  @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 testGetTags() { List<TagChild> tagChildren = new ArrayList<>(); tagChildren.add(new TagChild(new TagKey(TAG_TYPE, TAG_CODE), false)); tagChildren.add(new TagChild(new TagKey(TAG_TYPE, TAG_CODE_2), false)); TagListResponse tagListResponse = new TagListResponse(); tagListResponse.setTagChildren(tagChildren); when(tagService.getTags(TAG_TYPE, TAG_CODE)).thenReturn(tagListResponse); TagListResponse resultTagKeys = tagRestController.getTags(TAG_TYPE, TAG_CODE); verify(tagService).getTags(TAG_TYPE, TAG_CODE); verifyNoMoreInteractions(tagService); assertEquals(tagListResponse, resultTagKeys); ; }