### Question:
AuthResourceRdbmsDao implements AuthResourceDao { @Override public void persist(AuthResource authResource) throws AuthServerException { transaction(connection -> { authResourceCrudOperationsDao.storeResource(connection, authResource); 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(expectedExceptions = AuthServerException.class) public void testDuplicate() throws AuthServerException { AuthResource queue = new AuthResource(ResourceType.QUEUE.toString(), "queue1", true, "customer"); authResourceDao.persist(queue); }