VideoFoldersHandler extends AbstractFolderHandler { @PUT @Path("/{id}") @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) public ConfigurationFolder editVideoFolder(@PathParam("id") final String id, final ConfigurationFolder folder) { return editFolder(id, folder); } @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 testEditVideoFolder() { BackendManager backendManager = createMock(BackendManager.class); ConfigurationFolder folder = new ConfigurationFolder("videosTest", "editedVideosTest", System.getProperty("java.io.tmpdir")); backendManager.editFolder("videosTest", folder, VIDEO); expectLastCall().atLeastOnce(); replay(backendManager); VideoFoldersHandler videoFoldersHandler = new VideoFoldersHandler(backendManager); ConfigurationFolder newFolder = videoFoldersHandler.editVideoFolder("videosTest", folder); assertNotNull(newFolder); assertEquals(newFolder, folder); verify(backendManager); }