PictureFoldersHandler extends AbstractFolderHandler { @GET @Produces(APPLICATION_JSON) public Collection<ConfigurationFolder> getPictureFolders() { return getFolders(); } @Inject  PictureFoldersHandler(final BackendManager backendManager); @GET @Produces(APPLICATION_JSON) Collection<ConfigurationFolder> getPictureFolders(); @GET @Path("/{id}") @Produces(APPLICATION_JSON) ConfigurationFolder getPictureFolder(@PathParam("id") final String id); @POST @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) ConfigurationFolder addPictureFolder(final ConfigurationFolder folder); @PUT @Path("/{id}") @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) ConfigurationFolder editPictureFolder(@PathParam("id") final String id, final ConfigurationFolder folder); @DELETE @Path("/{id}") @Produces(APPLICATION_JSON) ConfigurationFolder removePictureFolder(@PathParam("id") final String id);  }
@Test public void testGetPictureFolders() { BackendManager backendManager = createMock(BackendManager.class); expect(backendManager.getFolders(PICTURE)).andReturn(newArrayList(new ConfigurationFolder("imagesTest", "imagesTest", "path"))).atLeastOnce(); replay(backendManager); PictureFoldersHandler pictureFoldersHandler = new PictureFoldersHandler(backendManager); assertNotNull(pictureFoldersHandler.getPictureFolders()); verify(backendManager); }