{"action":"created","comment":{"url":"https://api.github.com/repos/folio-org/mod-users/pulls/comments/293293263","pull_request_review_id":249237769,"id":293293263,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI5MzI5MzI2Mw==","diff_hunk":"@@ -40,323 +32,176 @@\n  */\n public class UserGroupAPI implements Groups {\n \n-  public static final String       GROUP_TABLE           = \"groups\";\n-  public static final String       GROUP_USER_JOIN_TABLE = \"groups_users\";\n-  public static final String       ID_FIELD_NAME         = \"id\";\n+  public static final String GROUP_TABLE = \"groups\";\n+  public static final String GROUP_USER_JOIN_TABLE = \"groups_users\";\n+  public static final String ID_FIELD_NAME = \"id\";\n \n-  private static final String       LOCATION_PREFIX       = \"/groups/\";\n-  private static final Logger       log                   = LoggerFactory.getLogger(UserGroupAPI.class);\n-  private final Messages            messages              = Messages.getInstance();\n+  private static final String LOCATION_PREFIX = \"/groups/\";\n+  private static final Logger log = LoggerFactory.getLogger(UserGroupAPI.class);\n+  private final Messages messages = Messages.getInstance();\n \n   @Validate\n   @Override\n   public void getGroups(String query, int offset, int limit,\n-      String lang, Map<String, String> okapiHeaders,\n-      Handler<AsyncResult<Response>> asyncResultHandler, Context vertxContext) {\n-\n-    /**\n-    * http://host:port/groups\n-    */\n-    vertxContext.runOnContext(v -> {\n-      try {\n-        System.out.println(\"sending... getGroups\");\n-        CQLWrapper cql = getCQL(query,limit, offset);\n-\n-        PostgresClientUtil.getInstance(vertxContext, okapiHeaders).get(GROUP_TABLE, Usergroup.class,\n-          new String[]{\"*\"}, cql, true, true,\n-            reply -> {\n-              try {\n-                if(reply.succeeded()){\n-                  Usergroups groups = new Usergroups();\n-                  @SuppressWarnings(\"unchecked\")\n-                  List<Usergroup> groupList = reply.result().getResults();\n-                  groups.setUsergroups(groupList);\n-                  groups.setTotalRecords(reply.result().getResultInfo().getTotalRecords());\n-                  asyncResultHandler.handle(io.vertx.core.Future.succeededFuture(GetGroupsResponse\n-                    .respond200WithApplicationJson(groups)));\n-                }\n-                else{\n-                  log.error(reply.cause().getMessage(), reply.cause());\n-                  asyncResultHandler.handle(io.vertx.core.Future.succeededFuture(GetGroupsResponse\n-                    .respond400WithTextPlain(reply.cause().getMessage())));\n-                }\n-              } catch (Exception e) {\n-                log.error(e.getMessage(), e);\n-                asyncResultHandler.handle(io.vertx.core.Future.succeededFuture(GetGroupsResponse\n-                  .respond500WithTextPlain(messages.getMessage(\n-                    lang, MessageConsts.InternalServerError))));\n-              }\n-            });\n-      }\n-      catch(FieldException fe){\n-        log.error(fe.getLocalizedMessage(), fe);\n-        asyncResultHandler.handle(Future.succeededFuture(GetUsersResponse.respond400WithTextPlain(\n-                \"CQL Parsing Error for '\" + query + \"': \" + fe.getLocalizedMessage())));\n-      }\n-      catch (Exception e) {\n-        log.error(e.getMessage(), e);\n-        asyncResultHandler.handle(io.vertx.core.Future.succeededFuture(GetGroupsResponse\n-          .respond500WithTextPlain(messages.getMessage(lang, MessageConsts.InternalServerError))));\n-      }\n-    });\n+    String lang, Map<String, String> okapiHeaders,\n+    Handler<AsyncResult<Response>> asyncResultHandler, Context vertxContext) {\n \n+    PgUtil.get(GROUP_TABLE, Usergroup.class, Usergroups.class, query, offset, limit, okapiHeaders,\n+      vertxContext, GetGroupsResponse.class, asyncResultHandler);\n   }\n \n   @Validate\n   @Override\n   public void postGroups(String lang, Usergroup entity,\n-          Map<String, String> okapiHeaders,\n-          Handler<AsyncResult<Response>> asyncResultHandler,\n-          Context vertxContext) {\n-\n-    vertxContext.runOnContext(v -> {\n-      try {\n-        System.out.println(\"sending... postGroups\");\n-        String id = entity.getId();\n-        if(id == null) {\n-          id = UUID.randomUUID().toString();\n-          entity.setId(id);\n+    Map<String, String> okapiHeaders,\n+    Handler<AsyncResult<Response>> asyncResultHandler,\n+    Context vertxContext) {\n+\n+    String id = entity.getId();\n+    if (id == null) {\n+      id = UUID.randomUUID().toString();\n+      entity.setId(id);\n+    }\n+    PostgresClientUtil.getInstance(vertxContext, okapiHeaders).save(","path":"src/main/java/org/folio/rest/impl/UserGroupAPI.java","position":132,"original_position":132,"commit_id":"2f08b2ae799511b331c10deaa4e189ce66e1dc5c","original_commit_id":"a38c657cba26970971a4ed578ccb6fbbcb54b457","user":{"login":"adamdickmeiss","id":8536543,"node_id":"MDQ6VXNlcjg1MzY1NDM=","avatar_url":"https://avatars1.githubusercontent.com/u/8536543?v=4","gravatar_id":"","url":"https://api.github.com/users/adamdickmeiss","html_url":"https://github.com/adamdickmeiss","followers_url":"https://api.github.com/users/adamdickmeiss/followers","following_url":"https://api.github.com/users/adamdickmeiss/following{/other_user}","gists_url":"https://api.github.com/users/adamdickmeiss/gists{/gist_id}","starred_url":"https://api.github.com/users/adamdickmeiss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamdickmeiss/subscriptions","organizations_url":"https://api.github.com/users/adamdickmeiss/orgs","repos_url":"https://api.github.com/users/adamdickmeiss/repos","events_url":"https://api.github.com/users/adamdickmeiss/events{/privacy}","received_events_url":"https://api.github.com/users/adamdickmeiss/received_events","type":"User","site_admin":false},"body":"That results in a regression.\r\nFailed tests: \r\n  RestVerticleIT.test2Group:1737 Test failed\r\n","created_at":"2019-06-13T09:45:03Z","updated_at":"2019-06-13T09:45:03Z","html_url":"https://github.com/folio-org/mod-users/pull/119#discussion_r293293263","pull_request_url":"https://api.github.com/repos/folio-org/mod-users/pulls/119","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/folio-org/mod-users/pulls/comments/293293263"},"html":{"href":"https://github.com/folio-org/mod-users/pull/119#discussion_r293293263"},"pull_request":{"href":"https://api.github.com/repos/folio-org/mod-users/pulls/119"}},"in_reply_to_id":293288398},"pull_request":{"url":"https://api.github.com/repos/folio-org/mod-users/pulls/119","id":287480555,"node_id":"MDExOlB1bGxSZXF1ZXN0Mjg3NDgwNTU1","html_url":"https://github.com/folio-org/mod-users/pull/119","diff_url":"https://github.com/folio-org/mod-users/pull/119.diff","patch_url":"https://github.com/folio-org/mod-users/pull/119.patch","issue_url":"https://api.github.com/repos/folio-org/mod-users/issues/119","number":119,"state":"open","locked":false,"title":"Refactor to use PgUtil MODUSERS-129","user":{"login":"adamdickmeiss","id":8536543,"node_id":"MDQ6VXNlcjg1MzY1NDM=","avatar_url":"https://avatars1.githubusercontent.com/u/8536543?v=4","gravatar_id":"","url":"https://api.github.com/users/adamdickmeiss","html_url":"https://github.com/adamdickmeiss","followers_url":"https://api.github.com/users/adamdickmeiss/followers","following_url":"https://api.github.com/users/adamdickmeiss/following{/other_user}","gists_url":"https://api.github.com/users/adamdickmeiss/gists{/gist_id}","starred_url":"https://api.github.com/users/adamdickmeiss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamdickmeiss/subscriptions","organizations_url":"https://api.github.com/users/adamdickmeiss/orgs","repos_url":"https://api.github.com/users/adamdickmeiss/repos","events_url":"https://api.github.com/users/adamdickmeiss/events{/privacy}","received_events_url":"https://api.github.com/users/adamdickmeiss/received_events","type":"User","site_admin":false},"body":"","created_at":"2019-06-12T12:18:21Z","updated_at":"2019-06-13T09:45:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2fdd43528fab12dbb607c21c066c73c9c2d7634c","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/folio-org/mod-users/pulls/119/commits","review_comments_url":"https://api.github.com/repos/folio-org/mod-users/pulls/119/comments","review_comment_url":"https://api.github.com/repos/folio-org/mod-users/pulls/comments{/number}","comments_url":"https://api.github.com/repos/folio-org/mod-users/issues/119/comments","statuses_url":"https://api.github.com/repos/folio-org/mod-users/statuses/2f08b2ae799511b331c10deaa4e189ce66e1dc5c","head":{"label":"folio-org:modusers-129-use-pgutil-refactor","ref":"modusers-129-use-pgutil-refactor","sha":"2f08b2ae799511b331c10deaa4e189ce66e1dc5c","user":{"login":"folio-org","id":16495055,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2NDk1MDU1","avatar_url":"https://avatars2.githubusercontent.com/u/16495055?v=4","gravatar_id":"","url":"https://api.github.com/users/folio-org","html_url":"https://github.com/folio-org","followers_url":"https://api.github.com/users/folio-org/followers","following_url":"https://api.github.com/users/folio-org/following{/other_user}","gists_url":"https://api.github.com/users/folio-org/gists{/gist_id}","starred_url":"https://api.github.com/users/folio-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/folio-org/subscriptions","organizations_url":"https://api.github.com/users/folio-org/orgs","repos_url":"https://api.github.com/users/folio-org/repos","events_url":"https://api.github.com/users/folio-org/events{/privacy}","received_events_url":"https://api.github.com/users/folio-org/received_events","type":"Organization","site_admin":false},"repo":{"id":70629815,"node_id":"MDEwOlJlcG9zaXRvcnk3MDYyOTgxNQ==","name":"mod-users","full_name":"folio-org/mod-users","private":false,"owner":{"login":"folio-org","id":16495055,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2NDk1MDU1","avatar_url":"https://avatars2.githubusercontent.com/u/16495055?v=4","gravatar_id":"","url":"https://api.github.com/users/folio-org","html_url":"https://github.com/folio-org","followers_url":"https://api.github.com/users/folio-org/followers","following_url":"https://api.github.com/users/folio-org/following{/other_user}","gists_url":"https://api.github.com/users/folio-org/gists{/gist_id}","starred_url":"https://api.github.com/users/folio-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/folio-org/subscriptions","organizations_url":"https://api.github.com/users/folio-org/orgs","repos_url":"https://api.github.com/users/folio-org/repos","events_url":"https://api.github.com/users/folio-org/events{/privacy}","received_events_url":"https://api.github.com/users/folio-org/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/folio-org/mod-users","description":"Domain Model to Manage Users","fork":false,"url":"https://api.github.com/repos/folio-org/mod-users","forks_url":"https://api.github.com/repos/folio-org/mod-users/forks","keys_url":"https://api.github.com/repos/folio-org/mod-users/keys{/key_id}","collaborators_url":"https://api.github.com/repos/folio-org/mod-users/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/folio-org/mod-users/teams","hooks_url":"https://api.github.com/repos/folio-org/mod-users/hooks","issue_events_url":"https://api.github.com/repos/folio-org/mod-users/issues/events{/number}","events_url":"https://api.github.com/repos/folio-org/mod-users/events","assignees_url":"https://api.github.com/repos/folio-org/mod-users/assignees{/user}","branches_url":"https://api.github.com/repos/folio-org/mod-users/branches{/branch}","tags_url":"https://api.github.com/repos/folio-org/mod-users/tags","blobs_url":"https://api.github.com/repos/folio-org/mod-users/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/folio-org/mod-users/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/folio-org/mod-users/git/refs{/sha}","trees_url":"https://api.github.com/repos/folio-org/mod-users/git/trees{/sha}","statuses_url":"https://api.github.com/repos/folio-org/mod-users/statuses/{sha}","languages_url":"https://api.github.com/repos/folio-org/mod-users/languages","stargazers_url":"https://api.github.com/repos/folio-org/mod-users/stargazers","contributors_url":"https://api.github.com/repos/folio-org/mod-users/contributors","subscribers_url":"https://api.github.com/repos/folio-org/mod-users/subscribers","subscription_url":"https://api.github.com/repos/folio-org/mod-users/subscription","commits_url":"https://api.github.com/repos/folio-org/mod-users/commits{/sha}","git_commits_url":"https://api.github.com/repos/folio-org/mod-users/git/commits{/sha}","comments_url":"https://api.github.com/repos/folio-org/mod-users/comments{/number}","issue_comment_url":"https://api.github.com/repos/folio-org/mod-users/issues/comments{/number}","contents_url":"https://api.github.com/repos/folio-org/mod-users/contents/{+path}","compare_url":"https://api.github.com/repos/folio-org/mod-users/compare/{base}...{head}","merges_url":"https://api.github.com/repos/folio-org/mod-users/merges","archive_url":"https://api.github.com/repos/folio-org/mod-users/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/folio-org/mod-users/downloads","issues_url":"https://api.github.com/repos/folio-org/mod-users/issues{/number}","pulls_url":"https://api.github.com/repos/folio-org/mod-users/pulls{/number}","milestones_url":"https://api.github.com/repos/folio-org/mod-users/milestones{/number}","notifications_url":"https://api.github.com/repos/folio-org/mod-users/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/folio-org/mod-users/labels{/name}","releases_url":"https://api.github.com/repos/folio-org/mod-users/releases{/id}","deployments_url":"https://api.github.com/repos/folio-org/mod-users/deployments","created_at":"2016-10-11T19:51:36Z","updated_at":"2019-06-12T08:55:54Z","pushed_at":"2019-06-13T09:41:59Z","git_url":"git://github.com/folio-org/mod-users.git","ssh_url":"git@github.com:folio-org/mod-users.git","clone_url":"https://github.com/folio-org/mod-users.git","svn_url":"https://github.com/folio-org/mod-users","homepage":null,"size":817,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":8,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":3,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":8,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"folio-org:master","ref":"master","sha":"d2f16d4c4a18d2f72d8ee5c31fec6926295b374c","user":{"login":"folio-org","id":16495055,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2NDk1MDU1","avatar_url":"https://avatars2.githubusercontent.com/u/16495055?v=4","gravatar_id":"","url":"https://api.github.com/users/folio-org","html_url":"https://github.com/folio-org","followers_url":"https://api.github.com/users/folio-org/followers","following_url":"https://api.github.com/users/folio-org/following{/other_user}","gists_url":"https://api.github.com/users/folio-org/gists{/gist_id}","starred_url":"https://api.github.com/users/folio-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/folio-org/subscriptions","organizations_url":"https://api.github.com/users/folio-org/orgs","repos_url":"https://api.github.com/users/folio-org/repos","events_url":"https://api.github.com/users/folio-org/events{/privacy}","received_events_url":"https://api.github.com/users/folio-org/received_events","type":"Organization","site_admin":false},"repo":{"id":70629815,"node_id":"MDEwOlJlcG9zaXRvcnk3MDYyOTgxNQ==","name":"mod-users","full_name":"folio-org/mod-users","private":false,"owner":{"login":"folio-org","id":16495055,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2NDk1MDU1","avatar_url":"https://avatars2.githubusercontent.com/u/16495055?v=4","gravatar_id":"","url":"https://api.github.com/users/folio-org","html_url":"https://github.com/folio-org","followers_url":"https://api.github.com/users/folio-org/followers","following_url":"https://api.github.com/users/folio-org/following{/other_user}","gists_url":"https://api.github.com/users/folio-org/gists{/gist_id}","starred_url":"https://api.github.com/users/folio-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/folio-org/subscriptions","organizations_url":"https://api.github.com/users/folio-org/orgs","repos_url":"https://api.github.com/users/folio-org/repos","events_url":"https://api.github.com/users/folio-org/events{/privacy}","received_events_url":"https://api.github.com/users/folio-org/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/folio-org/mod-users","description":"Domain Model to Manage Users","fork":false,"url":"https://api.github.com/repos/folio-org/mod-users","forks_url":"https://api.github.com/repos/folio-org/mod-users/forks","keys_url":"https://api.github.com/repos/folio-org/mod-users/keys{/key_id}","collaborators_url":"https://api.github.com/repos/folio-org/mod-users/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/folio-org/mod-users/teams","hooks_url":"https://api.github.com/repos/folio-org/mod-users/hooks","issue_events_url":"https://api.github.com/repos/folio-org/mod-users/issues/events{/number}","events_url":"https://api.github.com/repos/folio-org/mod-users/events","assignees_url":"https://api.github.com/repos/folio-org/mod-users/assignees{/user}","branches_url":"https://api.github.com/repos/folio-org/mod-users/branches{/branch}","tags_url":"https://api.github.com/repos/folio-org/mod-users/tags","blobs_url":"https://api.github.com/repos/folio-org/mod-users/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/folio-org/mod-users/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/folio-org/mod-users/git/refs{/sha}","trees_url":"https://api.github.com/repos/folio-org/mod-users/git/trees{/sha}","statuses_url":"https://api.github.com/repos/folio-org/mod-users/statuses/{sha}","languages_url":"https://api.github.com/repos/folio-org/mod-users/languages","stargazers_url":"https://api.github.com/repos/folio-org/mod-users/stargazers","contributors_url":"https://api.github.com/repos/folio-org/mod-users/contributors","subscribers_url":"https://api.github.com/repos/folio-org/mod-users/subscribers","subscription_url":"https://api.github.com/repos/folio-org/mod-users/subscription","commits_url":"https://api.github.com/repos/folio-org/mod-users/commits{/sha}","git_commits_url":"https://api.github.com/repos/folio-org/mod-users/git/commits{/sha}","comments_url":"https://api.github.com/repos/folio-org/mod-users/comments{/number}","issue_comment_url":"https://api.github.com/repos/folio-org/mod-users/issues/comments{/number}","contents_url":"https://api.github.com/repos/folio-org/mod-users/contents/{+path}","compare_url":"https://api.github.com/repos/folio-org/mod-users/compare/{base}...{head}","merges_url":"https://api.github.com/repos/folio-org/mod-users/merges","archive_url":"https://api.github.com/repos/folio-org/mod-users/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/folio-org/mod-users/downloads","issues_url":"https://api.github.com/repos/folio-org/mod-users/issues{/number}","pulls_url":"https://api.github.com/repos/folio-org/mod-users/pulls{/number}","milestones_url":"https://api.github.com/repos/folio-org/mod-users/milestones{/number}","notifications_url":"https://api.github.com/repos/folio-org/mod-users/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/folio-org/mod-users/labels{/name}","releases_url":"https://api.github.com/repos/folio-org/mod-users/releases{/id}","deployments_url":"https://api.github.com/repos/folio-org/mod-users/deployments","created_at":"2016-10-11T19:51:36Z","updated_at":"2019-06-12T08:55:54Z","pushed_at":"2019-06-13T09:41:59Z","git_url":"git://github.com/folio-org/mod-users.git","ssh_url":"git@github.com:folio-org/mod-users.git","clone_url":"https://github.com/folio-org/mod-users.git","svn_url":"https://github.com/folio-org/mod-users","homepage":null,"size":817,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":8,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":3,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":8,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/folio-org/mod-users/pulls/119"},"html":{"href":"https://github.com/folio-org/mod-users/pull/119"},"issue":{"href":"https://api.github.com/repos/folio-org/mod-users/issues/119"},"comments":{"href":"https://api.github.com/repos/folio-org/mod-users/issues/119/comments"},"review_comments":{"href":"https://api.github.com/repos/folio-org/mod-users/pulls/119/comments"},"review_comment":{"href":"https://api.github.com/repos/folio-org/mod-users/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/folio-org/mod-users/pulls/119/commits"},"statuses":{"href":"https://api.github.com/repos/folio-org/mod-users/statuses/2f08b2ae799511b331c10deaa4e189ce66e1dc5c"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"adamdickmeiss"}}