PictureFoldersHandler extends AbstractFolderHandler { @GET @Path("/{id}") @Produces(APPLICATION_JSON) public ConfigurationFolder getPictureFolder(@PathParam("id") final String id) { return getFolder(id); } @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 testGetPictureFolder() { BackendManager backendManager = createMock(BackendManager.class); expect(backendManager.getFolder("imagesTest", PICTURE)).andReturn(new ConfigurationFolder("imagesTest", "imagesTest", "path")).atLeastOnce(); replay(backendManager); PictureFoldersHandler pictureFoldersHandler = new PictureFoldersHandler(backendManager); assertNotNull(pictureFoldersHandler.getPictureFolder("imagesTest")); verify(backendManager); }