### Question:
AuthResourceRdbmsDao implements AuthResourceDao { @Override public void update(AuthResource authResource) throws AuthServerException { transaction(connection -> { authResourceCrudOperationsDao.updateOwner(connection, authResource.getResourceType(), authResource.getResourceName(), authResource.getOwner()); authResourceCrudOperationsDao.deleteUserGroupMappings(connection, authResource.getResourceType(), authResource.getResourceName()); authResourceCrudOperationsDao.persistUserGroupMappings(connection, authResource.getResourceType(), authResource.getResourceName(), authResource.getActionsUserGroupsMap()); }); } AuthResourceRdbmsDao(DataSource dataSource); @Override void persist(AuthResource authResource); @Override void update(AuthResource authResource); @Override boolean delete(String resourceType, String resource); @Override AuthResource read(String resourceType, String resourceName); @Override List<AuthResource> readAll(String resourceType, String ownerId); @Override List<AuthResource> readAll(String resourceType, String action, String ownerId,
                                      List<String> userGroups); @Override boolean isExists(String resourceType, String resource); @Override boolean updateOwner(String resourceType, String resourceName, String newOwner); @Override boolean addGroups(String resourceType, String resourceName, String action, List<String> groups); @Override boolean removeGroup(String resourceType, String resourceName, String action, String group);  }### Answer:
@Test(dependsOnMethods = {"testIsExists", "testReadAllByGroups", "testReadAll", "testRead", "testDuplicate"}) public void testUpdate() throws AuthServerException { Map<String, Set<String>> actionsUserGroupsMap = new HashMap<>(); actionsUserGroupsMap.put("publish", new HashSet<>(Arrays.asList("architect", "customer", "manager"))); AuthResource exchange = new AuthResource(ResourceType.EXCHANGE.toString(), "exchange1", true, "developer", actionsUserGroupsMap); authResourceDao.update(exchange); List<AuthResource> manager = authResourceDao.readAll(ResourceType.EXCHANGE.toString(), "manager"); List<AuthResource> developer = authResourceDao.readAll(ResourceType.EXCHANGE.toString(), "developer"); Assert.assertEquals(manager.size(), 1); Assert.assertEquals(developer.size(), 1); AuthResource exchange1 = authResourceDao.read(ResourceType.EXCHANGE.toString(), "exchange1"); Assert.assertEquals(exchange1.getOwner(), "developer"); List<AuthResource> exchanges = authResourceDao.readAll(ResourceType.EXCHANGE.toString(), "publish", "manager", Collections.singletonList("manager")); Assert.assertEquals(exchanges.size(), 2); }