### Question:
FileInputResource implements Resource<FileInput> { @POST @Path("/update") @Consumes(Constants.APPLICATION_JSON_RESOURCE_PATH) @Produces(Constants.APPLICATION_JSON_RESOURCE_PATH) @Override public FileInput update(FileInput fileInput) { try { HibernateUtil.update(fileInput); } catch (EntityStorageException e1) { e1.printStackTrace(); } catch (Exception e) { e.printStackTrace(); throw new WebException(e, Response.Status.BAD_REQUEST); } return fileInput; } FileInputResource(); @GET @Path("/available-input-files") @Produces(Constants.APPLICATION_JSON_RESOURCE_PATH) List<String> listAvailableInputFiles(); @GET @Produces(Constants.APPLICATION_JSON_RESOURCE_PATH) @SuppressWarnings(Constants.SUPPRESS_WARNINGS_UNCHECKED) @Override List<FileInput> getAll(); List<String> getAllPaths(); @POST @Path("/update") @Consumes(Constants.APPLICATION_JSON_RESOURCE_PATH) @Produces(Constants.APPLICATION_JSON_RESOURCE_PATH) @Override FileInput update(FileInput fileInput); @GET @Path("/get/{id}") @Produces(Constants.APPLICATION_JSON_RESOURCE_PATH) @Override FileInput get(@PathParam("id") long id); @POST @Path("/get-directory-files") @Consumes(Constants.APPLICATION_JSON_RESOURCE_PATH) @Produces(Constants.APPLICATION_JSON_RESOURCE_PATH) void getDirectoryFiles(FileInput file); @POST @Path(Constants.STORE_RESOURCE_PATH) @Consumes(Constants.APPLICATION_JSON_RESOURCE_PATH) @Produces(Constants.APPLICATION_JSON_RESOURCE_PATH) void executeDatabaseStore(FileInput file); @POST @Path(Constants.STORE_RESOURCE_PATH) @Consumes("multipart/form-data") @Produces(Constants.APPLICATION_JSON_RESOURCE_PATH) void uploadAndExecuteStore(@FormDataParam("file") InputStream uploadedInputStream,
                         @FormDataParam("file") FormDataContentDisposition fileDetail); FileInput store(FileInput file); @DELETE @Path("/delete/{id}") @Override void delete(@PathParam("id") long id);  }### Answer:
@Test public void testUpdate() throws EntityStorageException { HibernateUtil.clear(); FileInputResource fileInputResource = new FileInputResource(); FileInput fileInput = new FileInput("old file"); FileInput actualFileInput = fileInputResource.store(fileInput); assertEquals(fileInput, actualFileInput); fileInput.setComment("new comment").setFileName("new file"); fileInputResource.update(fileInput); actualFileInput = fileInputResource.get(fileInput.getId()); assertEquals(fileInput, actualFileInput); HibernateUtil.clear(); }