AudioFoldersHandler extends AbstractFolderHandler { @GET @Path("/{id}") @Produces(APPLICATION_JSON) public ConfigurationFolder getAudioFolder(@PathParam("id") final String id) { return getFolder(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 testGetAudioFolder() { BackendManager backendManager = createMock(BackendManager.class); expect(backendManager.getFolder("audiosTest", AUDIO)).andReturn(new ConfigurationFolder("audiosTest", "audiosTest", "path")).atLeastOnce(); replay(backendManager); AudioFoldersHandler audioFoldersHandler = new AudioFoldersHandler(backendManager); assertNotNull(audioFoldersHandler.getAudioFolder("audiosTest")); verify(backendManager); }