### Question:
DatabaseConnectionResource implements Resource<DatabaseConnection> { @POST @Path("/update") @Consumes(Constants.APPLICATION_JSON_RESOURCE_PATH) @Produces(Constants.APPLICATION_JSON_RESOURCE_PATH) @Override public DatabaseConnection update(DatabaseConnection databaseConnection) { try { HibernateUtil.update(databaseConnection); return databaseConnection; } catch (Exception e) { e.printStackTrace(); throw new WebException(e, Response.Status.BAD_REQUEST); } }  @GET @Produces(Constants.APPLICATION_JSON_RESOURCE_PATH) @SuppressWarnings(Constants.SUPPRESS_WARNINGS_UNCHECKED) @Override List<DatabaseConnection> getAll(); @GET @Path("/get/{id}") @Produces(Constants.APPLICATION_JSON_RESOURCE_PATH) @Override DatabaseConnection get(@PathParam("id") long id); @POST @Path(Constants.STORE_RESOURCE_PATH) @Consumes(Constants.APPLICATION_JSON_RESOURCE_PATH) @Produces(Constants.APPLICATION_JSON_RESOURCE_PATH) DatabaseConnection executeDatabaseStore(DatabaseConnection dbConnection); DatabaseConnection store(DatabaseConnection dbConnection); @DELETE @Path("/delete/{id}") @Override void delete(@PathParam("id") long id); @POST @Path("/update") @Consumes(Constants.APPLICATION_JSON_RESOURCE_PATH) @Produces(Constants.APPLICATION_JSON_RESOURCE_PATH) @Override DatabaseConnection update(DatabaseConnection databaseConnection);  }### Answer:
@Test public void testUpdate() throws EntityStorageException { HibernateUtil.clear(); DatabaseConnection databaseConnection = new DatabaseConnection("url1", "old user", "old password", DbSystem.DB2); DatabaseConnection actualDatabaseConnection = dbResource.store(databaseConnection); assertEquals(databaseConnection, actualDatabaseConnection); databaseConnection.setComment("new comment").setPassword("new password") .setUsername("new user"); dbResource.update(databaseConnection); actualDatabaseConnection = dbResource.get(databaseConnection.getId()); assertEquals(databaseConnection, actualDatabaseConnection); HibernateUtil.clear(); }