TagTypeRestController { @RequestMapping(value = TAG_TYPES_URI_PREFIX, method = RequestMethod.GET) @Secured(SecurityFunctions.FN_TAG_TYPES_ALL_GET) public TagTypeKeys getTagTypes() { return tagTypeService.getTagTypes(); }  @RequestMapping(value = TAG_TYPES_URI_PREFIX, method = RequestMethod.POST, consumes = {"application/xml", "application/json"}) @Secured(SecurityFunctions.FN_TAG_TYPES_POST) TagType createTagType(@RequestBody TagTypeCreateRequest request); @RequestMapping(value = TAG_TYPES_URI_PREFIX + "/{tagTypeCode}", method = RequestMethod.DELETE) @Secured(SecurityFunctions.FN_TAG_TYPES_DELETE) TagType deleteTagType(@PathVariable("tagTypeCode") String tagTypeCode); @RequestMapping(value = TAG_TYPES_URI_PREFIX + "/{tagTypeCode}", method = RequestMethod.GET) @Secured(SecurityFunctions.FN_TAG_TYPES_GET) TagType getTagType(@PathVariable("tagTypeCode") String tagTypeCode); @RequestMapping(value = TAG_TYPES_URI_PREFIX, method = RequestMethod.GET) @Secured(SecurityFunctions.FN_TAG_TYPES_ALL_GET) TagTypeKeys getTagTypes(); @RequestMapping(value = TAG_TYPES_URI_PREFIX + "/search", method = RequestMethod.POST, consumes = {"application/xml", "application/json"}) @Secured(SecurityFunctions.FN_TAG_TYPES_SEARCH_POST) TagTypeSearchResponse searchTagTypes(@RequestBody TagTypeSearchRequest request,
        @RequestParam(value = "fields", required = false, defaultValue = "") Set<String> fields); @RequestMapping(value = TAG_TYPES_URI_PREFIX + "/{tagTypeCode}", method = RequestMethod.PUT, consumes = {"application/xml", "application/json"}) @Secured(SecurityFunctions.FN_TAG_TYPES_PUT) TagType updateTagType(@PathVariable("tagTypeCode") String tagTypeCode, @RequestBody TagTypeUpdateRequest request); final static String TAG_TYPES_URI_PREFIX; }
@Test public void testGetTagTypes() throws Exception { TagTypeKeys tagTypeKeys = new TagTypeKeys(Arrays.asList(new TagTypeKey(TAG_TYPE))); when(tagTypeService.getTagTypes()).thenReturn(tagTypeKeys); TagTypeKeys resultTagTypeKeys = tagTypeRestController.getTagTypes(); verify(tagTypeService).getTagTypes(); verifyNoMoreInteractions(tagTypeService); assertEquals(tagTypeKeys, resultTagTypeKeys); }