RESTBrowseController extends RESTAbstractController { public void getVideos(HttpServletRequest request, HttpServletResponse response) throws Exception { XMLBuilder builder = createXMLBuilder(request, response, true); builder.add("videos", true); builder.endAll(); response.getWriter().print(builder); }  void getMusicFolders(HttpServletRequest request, HttpServletResponse response); void getIndexes(HttpServletRequest request, HttpServletResponse response); void getMusicDirectory(HttpServletRequest request, HttpServletResponse response); void getArtists(HttpServletRequest request, HttpServletResponse response); void getArtist(HttpServletRequest request, HttpServletResponse response); void getAlbum(HttpServletRequest request, HttpServletResponse response); void getSong(HttpServletRequest request, HttpServletResponse response); void getVideos(HttpServletRequest request, HttpServletResponse response); void getAlbumList(HttpServletRequest request, HttpServletResponse response); void getAlbumList2(HttpServletRequest request, HttpServletResponse response); void getRandomSongs(HttpServletRequest request, HttpServletResponse response); void getNowPlaying(HttpServletRequest request, HttpServletResponse response); void getStarred(HttpServletRequest request, HttpServletResponse response); void getStarred2(HttpServletRequest request, HttpServletResponse response); void setSettingsService(SettingsService settingsService); void setSecurityService(SecurityService securityService); void setMediaFolderService(MediaFolderService mediaFolderService); void setMediaFileService(MediaFileService mediaFileService); void setTranscodingService(TranscodingService transcodingService); void setLeftController(LeftController leftController); void setHomeController(HomeController homeController); void setStatusService(StatusService statusService); void setLibraryBrowserService(LibraryBrowserService libraryBrowserService); void setArtistIndexService(ArtistIndexService artistIndexService); void setArtistInfoService(ArtistInfoService artistInfoService); void setTagService(TagService tagService); void setPlaylistGeneratorService(PlaylistGeneratorService playlistGeneratorService); void setArtistRecommendationService(ArtistRecommendationService artistRecommendationService); void setDirectoryBrowserService(DirectoryBrowserService directoryBrowserService);  }
@Test public void browse_getVideos() throws Exception { StringWriter sw = new StringWriter(); HttpServletRequest request = mock(HttpServletRequest.class); HttpServletResponse response = mock(HttpServletResponse.class); when(response.getWriter()).thenReturn(new PrintWriter(sw)); browseController.getVideos(request, response); assertXMLEqual(new ResourceUtil(GET_VIDEOS).getContent(), sw.getBuffer().toString()); }