VideoFoldersHandler extends AbstractFolderHandler { @GET @Produces(APPLICATION_JSON) public Collection<ConfigurationFolder> getVideoFolders() { return getFolders(); } @Inject  VideoFoldersHandler(final BackendManager backendManager); @GET @Produces(APPLICATION_JSON) Collection<ConfigurationFolder> getVideoFolders(); @GET @Path("/{id}") @Produces(APPLICATION_JSON) ConfigurationFolder getVideoFolder(@PathParam("id") final String id); @POST @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) ConfigurationFolder addVideoFolder(final ConfigurationFolder folder); @PUT @Path("/{id}") @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) ConfigurationFolder editVideoFolder(@PathParam("id") final String id, final ConfigurationFolder folder); @DELETE @Path("/{id}") @Produces(APPLICATION_JSON) ConfigurationFolder removeVideoFolder(@PathParam("id") final String id);  }
@Test public void testGetVideoFolders() { BackendManager backendManager = createMock(BackendManager.class); expect(backendManager.getFolders(VIDEO)).andReturn(newArrayList(new ConfigurationFolder("videosTest", "videosTest", System.getProperty("java.io.tmpdir")))).atLeastOnce(); replay(backendManager); VideoFoldersHandler videoFoldersHandler = new VideoFoldersHandler(backendManager); assertNotNull(videoFoldersHandler.getVideoFolders()); verify(backendManager); }