AudioFoldersHandler extends AbstractFolderHandler { @DELETE @Path("/{id}") @Produces(APPLICATION_JSON) public ConfigurationFolder removeAudioFolder(@PathParam("id") final String id) { return removeFolder(id); } @Inject  AudioFoldersHandler(final BackendManager backendManager); @GET @Produces(APPLICATION_JSON) Collection<ConfigurationFolder> getAudioFolders(); @GET @Path("/{id}") @Produces(APPLICATION_JSON) ConfigurationFolder getAudioFolder(@PathParam("id") final String id); @POST @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) ConfigurationFolder addAudioFolder(final ConfigurationFolder folder); @PUT @Path("/{id}") @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) ConfigurationFolder editAudioFolder(@PathParam("id") final String id, final ConfigurationFolder folder); @DELETE @Path("/{id}") @Produces(APPLICATION_JSON) ConfigurationFolder removeAudioFolder(@PathParam("id") final String id);  }
@Test public void testRemoveAudioFolder() { BackendManager backendManager = createMock(BackendManager.class); backendManager.removeFolder("audiosTest", AUDIO); expectLastCall().atLeastOnce(); replay(backendManager); AudioFoldersHandler audioFoldersHandler = new AudioFoldersHandler(backendManager); ConfigurationFolder folder = audioFoldersHandler.removeAudioFolder("audiosTest"); assertNotNull(folder); assertEquals(folder.getId(), "audiosTest"); verify(backendManager); }