{"action":"created","comment":{"url":"https://api.github.com/repos/fabric8io/kubernetes-model/pulls/comments/198501928","pull_request_review_id":132441741,"id":198501928,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5ODUwMTkyOA==","diff_hunk":"@@ -0,0 +1,90 @@\n+/**\n+ * Copyright (C) 2011 Red Hat, Inc.\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ *         http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+package io.fabric8.kubernetes.api.model;\n+\n+import com.fasterxml.jackson.databind.ObjectMapper;\n+import io.fabric8.kubernetes.api.model.rbac.KubernetesRoleBinding;\n+import io.fabric8.kubernetes.api.model.rbac.KubernetesSubjectBuilder;\n+import io.fabric8.kubernetes.api.model.rbac.KubernetesRoleRefBuilder;\n+import io.fabric8.kubernetes.api.model.rbac.KubernetesRoleBindingBuilder;\n+import org.junit.Test;\n+\n+import static net.javacrumbs.jsonunit.core.Option.IGNORING_ARRAY_ORDER;\n+import static net.javacrumbs.jsonunit.core.Option.IGNORING_EXTRA_FIELDS;\n+import static net.javacrumbs.jsonunit.core.Option.TREATING_NULL_AS_ABSENT;\n+import static net.javacrumbs.jsonunit.fluent.JsonFluentAssert.assertThatJson;\n+import static org.junit.Assert.assertEquals;\n+import static org.junit.Assert.assertNotNull;\n+\n+public class KubernetesRoleBindingTest {\n+\n+    private final ObjectMapper mapper = new ObjectMapper();\n+\n+    @Test\n+    public void kubernetesRoleBindingTest() throws Exception {\n+        // given\n+        final String originalJson = Helper.loadJson(\"/valid-kubernetesRoleBinding.json\");\n+\n+        // when\n+        final KubernetesRoleBinding kubernetesRoleBinding = mapper.readValue(originalJson, KubernetesRoleBinding.class);\n+        final String serializedJson = mapper.writeValueAsString(kubernetesRoleBinding);\n+\n+        // then\n+        assertThatJson(serializedJson).when(IGNORING_ARRAY_ORDER, TREATING_NULL_AS_ABSENT, IGNORING_EXTRA_FIELDS)\n+                .isEqualTo(originalJson);\n+    }\n+\n+    @Test\n+    public void kubernetesRoleBuilderTest() {\n+\n+        KubernetesRoleBinding kubernetesRoleBinding = new KubernetesRoleBindingBuilder()\n+                .withNewMetadata()\n+                    .withName(\"read-jobs\")\n+                    .withNamespace(\"default\")\n+                .endMetadata()\n+                .addToSubjects(0, new KubernetesSubjectBuilder()\n+                        .withApiGroup(\"rbac.authorization.k8s.io\")\n+                        .withKind(\"User\")\n+                        .withName(\"jane\")\n+                        .withNamespace(\"default\")\n+                        .build()\n+                )\n+                .withRoleRef(new KubernetesRoleRefBuilder()\n+                        .withApiGroup(\"rbac.authorization.k8s.io\")\n+                        .withKind(\"Role\")\n+                        .withName(\"job-reader\")\n+                        .build()\n+                )\n+                .build();\n+\n+        assertNotNull(kubernetesRoleBinding);","path":"kubernetes-model/src/test/java/io/fabric8/kubernetes/api/model/KubernetesRoleBindingTest.java","position":73,"original_position":73,"commit_id":"8df00d73ccc233b22655ddf78bb4f5980ba9a7ac","original_commit_id":"8df00d73ccc233b22655ddf78bb4f5980ba9a7ac","user":{"login":"hrishin","id":28615674,"node_id":"MDQ6VXNlcjI4NjE1Njc0","avatar_url":"https://avatars0.githubusercontent.com/u/28615674?v=4","gravatar_id":"","url":"https://api.github.com/users/hrishin","html_url":"https://github.com/hrishin","followers_url":"https://api.github.com/users/hrishin/followers","following_url":"https://api.github.com/users/hrishin/following{/other_user}","gists_url":"https://api.github.com/users/hrishin/gists{/gist_id}","starred_url":"https://api.github.com/users/hrishin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hrishin/subscriptions","organizations_url":"https://api.github.com/users/hrishin/orgs","repos_url":"https://api.github.com/users/hrishin/repos","events_url":"https://api.github.com/users/hrishin/events{/privacy}","received_events_url":"https://api.github.com/users/hrishin/received_events","type":"User","site_admin":false},"body":"Instead of doing a bunch of assertions can we serialize `mapper.writeValueAsString()` and compare with expected string.?","created_at":"2018-06-27T13:48:44Z","updated_at":"2018-06-27T13:49:36Z","html_url":"https://github.com/fabric8io/kubernetes-model/pull/312#discussion_r198501928","pull_request_url":"https://api.github.com/repos/fabric8io/kubernetes-model/pulls/312","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/fabric8io/kubernetes-model/pulls/comments/198501928"},"html":{"href":"https://github.com/fabric8io/kubernetes-model/pull/312#discussion_r198501928"},"pull_request":{"href":"https://api.github.com/repos/fabric8io/kubernetes-model/pulls/312"}}},"pull_request":{"url":"https://api.github.com/repos/fabric8io/kubernetes-model/pulls/312","id":193612144,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkzNjEyMTQ0","html_url":"https://github.com/fabric8io/kubernetes-model/pull/312","diff_url":"https://github.com/fabric8io/kubernetes-model/pull/312.diff","patch_url":"https://github.com/fabric8io/kubernetes-model/pull/312.patch","issue_url":"https://api.github.com/repos/fabric8io/kubernetes-model/issues/312","number":312,"state":"open","locked":false,"title":"Adds support for Kubernetes RBAC and Openshift NetNameSpace resources","user":{"login":"piyush1594","id":19270240,"node_id":"MDQ6VXNlcjE5MjcwMjQw","avatar_url":"https://avatars1.githubusercontent.com/u/19270240?v=4","gravatar_id":"","url":"https://api.github.com/users/piyush1594","html_url":"https://github.com/piyush1594","followers_url":"https://api.github.com/users/piyush1594/followers","following_url":"https://api.github.com/users/piyush1594/following{/other_user}","gists_url":"https://api.github.com/users/piyush1594/gists{/gist_id}","starred_url":"https://api.github.com/users/piyush1594/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/piyush1594/subscriptions","organizations_url":"https://api.github.com/users/piyush1594/orgs","repos_url":"https://api.github.com/users/piyush1594/repos","events_url":"https://api.github.com/users/piyush1594/events{/privacy}","received_events_url":"https://api.github.com/users/piyush1594/received_events","type":"User","site_admin":false},"body":"Adds support for Kubernetes RBAC resources\r\nAdds support for Openshift NetNameSpace Resource\r\n#202\r\n#189","created_at":"2018-06-08T13:21:06Z","updated_at":"2018-06-27T13:49:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"edb239caef3ecf2dbcd279e0b622723d7e8e46c9","assignee":null,"assignees":[],"requested_reviewers":[{"login":"rohanKanojia","id":13834498,"node_id":"MDQ6VXNlcjEzODM0NDk4","avatar_url":"https://avatars3.githubusercontent.com/u/13834498?v=4","gravatar_id":"","url":"https://api.github.com/users/rohanKanojia","html_url":"https://github.com/rohanKanojia","followers_url":"https://api.github.com/users/rohanKanojia/followers","following_url":"https://api.github.com/users/rohanKanojia/following{/other_user}","gists_url":"https://api.github.com/users/rohanKanojia/gists{/gist_id}","starred_url":"https://api.github.com/users/rohanKanojia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rohanKanojia/subscriptions","organizations_url":"https://api.github.com/users/rohanKanojia/orgs","repos_url":"https://api.github.com/users/rohanKanojia/repos","events_url":"https://api.github.com/users/rohanKanojia/events{/privacy}","received_events_url":"https://api.github.com/users/rohanKanojia/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/fabric8io/kubernetes-model/pulls/312/commits","review_comments_url":"https://api.github.com/repos/fabric8io/kubernetes-model/pulls/312/comments","review_comment_url":"https://api.github.com/repos/fabric8io/kubernetes-model/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fabric8io/kubernetes-model/issues/312/comments","statuses_url":"https://api.github.com/repos/fabric8io/kubernetes-model/statuses/8df00d73ccc233b22655ddf78bb4f5980ba9a7ac","head":{"label":"piyush1594:iss_202","ref":"iss_202","sha":"8df00d73ccc233b22655ddf78bb4f5980ba9a7ac","user":{"login":"piyush1594","id":19270240,"node_id":"MDQ6VXNlcjE5MjcwMjQw","avatar_url":"https://avatars1.githubusercontent.com/u/19270240?v=4","gravatar_id":"","url":"https://api.github.com/users/piyush1594","html_url":"https://github.com/piyush1594","followers_url":"https://api.github.com/users/piyush1594/followers","following_url":"https://api.github.com/users/piyush1594/following{/other_user}","gists_url":"https://api.github.com/users/piyush1594/gists{/gist_id}","starred_url":"https://api.github.com/users/piyush1594/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/piyush1594/subscriptions","organizations_url":"https://api.github.com/users/piyush1594/orgs","repos_url":"https://api.github.com/users/piyush1594/repos","events_url":"https://api.github.com/users/piyush1594/events{/privacy}","received_events_url":"https://api.github.com/users/piyush1594/received_events","type":"User","site_admin":false},"repo":{"id":106398879,"node_id":"MDEwOlJlcG9zaXRvcnkxMDYzOTg4Nzk=","name":"kubernetes-model","full_name":"piyush1594/kubernetes-model","owner":{"login":"piyush1594","id":19270240,"node_id":"MDQ6VXNlcjE5MjcwMjQw","avatar_url":"https://avatars1.githubusercontent.com/u/19270240?v=4","gravatar_id":"","url":"https://api.github.com/users/piyush1594","html_url":"https://github.com/piyush1594","followers_url":"https://api.github.com/users/piyush1594/followers","following_url":"https://api.github.com/users/piyush1594/following{/other_user}","gists_url":"https://api.github.com/users/piyush1594/gists{/gist_id}","starred_url":"https://api.github.com/users/piyush1594/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/piyush1594/subscriptions","organizations_url":"https://api.github.com/users/piyush1594/orgs","repos_url":"https://api.github.com/users/piyush1594/repos","events_url":"https://api.github.com/users/piyush1594/events{/privacy}","received_events_url":"https://api.github.com/users/piyush1594/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/piyush1594/kubernetes-model","description":"JSON schema generator for OpenShift Origin API objects","fork":true,"url":"https://api.github.com/repos/piyush1594/kubernetes-model","forks_url":"https://api.github.com/repos/piyush1594/kubernetes-model/forks","keys_url":"https://api.github.com/repos/piyush1594/kubernetes-model/keys{/key_id}","collaborators_url":"https://api.github.com/repos/piyush1594/kubernetes-model/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/piyush1594/kubernetes-model/teams","hooks_url":"https://api.github.com/repos/piyush1594/kubernetes-model/hooks","issue_events_url":"https://api.github.com/repos/piyush1594/kubernetes-model/issues/events{/number}","events_url":"https://api.github.com/repos/piyush1594/kubernetes-model/events","assignees_url":"https://api.github.com/repos/piyush1594/kubernetes-model/assignees{/user}","branches_url":"https://api.github.com/repos/piyush1594/kubernetes-model/branches{/branch}","tags_url":"https://api.github.com/repos/piyush1594/kubernetes-model/tags","blobs_url":"https://api.github.com/repos/piyush1594/kubernetes-model/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/piyush1594/kubernetes-model/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/piyush1594/kubernetes-model/git/refs{/sha}","trees_url":"https://api.github.com/repos/piyush1594/kubernetes-model/git/trees{/sha}","statuses_url":"https://api.github.com/repos/piyush1594/kubernetes-model/statuses/{sha}","languages_url":"https://api.github.com/repos/piyush1594/kubernetes-model/languages","stargazers_url":"https://api.github.com/repos/piyush1594/kubernetes-model/stargazers","contributors_url":"https://api.github.com/repos/piyush1594/kubernetes-model/contributors","subscribers_url":"https://api.github.com/repos/piyush1594/kubernetes-model/subscribers","subscription_url":"https://api.github.com/repos/piyush1594/kubernetes-model/subscription","commits_url":"https://api.github.com/repos/piyush1594/kubernetes-model/commits{/sha}","git_commits_url":"https://api.github.com/repos/piyush1594/kubernetes-model/git/commits{/sha}","comments_url":"https://api.github.com/repos/piyush1594/kubernetes-model/comments{/number}","issue_comment_url":"https://api.github.com/repos/piyush1594/kubernetes-model/issues/comments{/number}","contents_url":"https://api.github.com/repos/piyush1594/kubernetes-model/contents/{+path}","compare_url":"https://api.github.com/repos/piyush1594/kubernetes-model/compare/{base}...{head}","merges_url":"https://api.github.com/repos/piyush1594/kubernetes-model/merges","archive_url":"https://api.github.com/repos/piyush1594/kubernetes-model/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/piyush1594/kubernetes-model/downloads","issues_url":"https://api.github.com/repos/piyush1594/kubernetes-model/issues{/number}","pulls_url":"https://api.github.com/repos/piyush1594/kubernetes-model/pulls{/number}","milestones_url":"https://api.github.com/repos/piyush1594/kubernetes-model/milestones{/number}","notifications_url":"https://api.github.com/repos/piyush1594/kubernetes-model/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/piyush1594/kubernetes-model/labels{/name}","releases_url":"https://api.github.com/repos/piyush1594/kubernetes-model/releases{/id}","deployments_url":"https://api.github.com/repos/piyush1594/kubernetes-model/deployments","created_at":"2017-10-10T09:49:23Z","updated_at":"2017-10-10T09:49:27Z","pushed_at":"2018-06-27T12:33:13Z","git_url":"git://github.com/piyush1594/kubernetes-model.git","ssh_url":"git@github.com:piyush1594/kubernetes-model.git","clone_url":"https://github.com/piyush1594/kubernetes-model.git","svn_url":"https://github.com/piyush1594/kubernetes-model","homepage":null,"size":193901,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"fabric8io:master","ref":"master","sha":"194f4ad3ed0e407d9c239824ca320476953ca9db","user":{"login":"fabric8io","id":6074349,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYwNzQzNDk=","avatar_url":"https://avatars1.githubusercontent.com/u/6074349?v=4","gravatar_id":"","url":"https://api.github.com/users/fabric8io","html_url":"https://github.com/fabric8io","followers_url":"https://api.github.com/users/fabric8io/followers","following_url":"https://api.github.com/users/fabric8io/following{/other_user}","gists_url":"https://api.github.com/users/fabric8io/gists{/gist_id}","starred_url":"https://api.github.com/users/fabric8io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabric8io/subscriptions","organizations_url":"https://api.github.com/users/fabric8io/orgs","repos_url":"https://api.github.com/users/fabric8io/repos","events_url":"https://api.github.com/users/fabric8io/events{/privacy}","received_events_url":"https://api.github.com/users/fabric8io/received_events","type":"Organization","site_admin":false},"repo":{"id":28805028,"node_id":"MDEwOlJlcG9zaXRvcnkyODgwNTAyOA==","name":"kubernetes-model","full_name":"fabric8io/kubernetes-model","owner":{"login":"fabric8io","id":6074349,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYwNzQzNDk=","avatar_url":"https://avatars1.githubusercontent.com/u/6074349?v=4","gravatar_id":"","url":"https://api.github.com/users/fabric8io","html_url":"https://github.com/fabric8io","followers_url":"https://api.github.com/users/fabric8io/followers","following_url":"https://api.github.com/users/fabric8io/following{/other_user}","gists_url":"https://api.github.com/users/fabric8io/gists{/gist_id}","starred_url":"https://api.github.com/users/fabric8io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabric8io/subscriptions","organizations_url":"https://api.github.com/users/fabric8io/orgs","repos_url":"https://api.github.com/users/fabric8io/repos","events_url":"https://api.github.com/users/fabric8io/events{/privacy}","received_events_url":"https://api.github.com/users/fabric8io/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fabric8io/kubernetes-model","description":"JSON schema generator for OpenShift Origin API objects","fork":false,"url":"https://api.github.com/repos/fabric8io/kubernetes-model","forks_url":"https://api.github.com/repos/fabric8io/kubernetes-model/forks","keys_url":"https://api.github.com/repos/fabric8io/kubernetes-model/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fabric8io/kubernetes-model/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fabric8io/kubernetes-model/teams","hooks_url":"https://api.github.com/repos/fabric8io/kubernetes-model/hooks","issue_events_url":"https://api.github.com/repos/fabric8io/kubernetes-model/issues/events{/number}","events_url":"https://api.github.com/repos/fabric8io/kubernetes-model/events","assignees_url":"https://api.github.com/repos/fabric8io/kubernetes-model/assignees{/user}","branches_url":"https://api.github.com/repos/fabric8io/kubernetes-model/branches{/branch}","tags_url":"https://api.github.com/repos/fabric8io/kubernetes-model/tags","blobs_url":"https://api.github.com/repos/fabric8io/kubernetes-model/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fabric8io/kubernetes-model/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fabric8io/kubernetes-model/git/refs{/sha}","trees_url":"https://api.github.com/repos/fabric8io/kubernetes-model/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fabric8io/kubernetes-model/statuses/{sha}","languages_url":"https://api.github.com/repos/fabric8io/kubernetes-model/languages","stargazers_url":"https://api.github.com/repos/fabric8io/kubernetes-model/stargazers","contributors_url":"https://api.github.com/repos/fabric8io/kubernetes-model/contributors","subscribers_url":"https://api.github.com/repos/fabric8io/kubernetes-model/subscribers","subscription_url":"https://api.github.com/repos/fabric8io/kubernetes-model/subscription","commits_url":"https://api.github.com/repos/fabric8io/kubernetes-model/commits{/sha}","git_commits_url":"https://api.github.com/repos/fabric8io/kubernetes-model/git/commits{/sha}","comments_url":"https://api.github.com/repos/fabric8io/kubernetes-model/comments{/number}","issue_comment_url":"https://api.github.com/repos/fabric8io/kubernetes-model/issues/comments{/number}","contents_url":"https://api.github.com/repos/fabric8io/kubernetes-model/contents/{+path}","compare_url":"https://api.github.com/repos/fabric8io/kubernetes-model/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fabric8io/kubernetes-model/merges","archive_url":"https://api.github.com/repos/fabric8io/kubernetes-model/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fabric8io/kubernetes-model/downloads","issues_url":"https://api.github.com/repos/fabric8io/kubernetes-model/issues{/number}","pulls_url":"https://api.github.com/repos/fabric8io/kubernetes-model/pulls{/number}","milestones_url":"https://api.github.com/repos/fabric8io/kubernetes-model/milestones{/number}","notifications_url":"https://api.github.com/repos/fabric8io/kubernetes-model/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fabric8io/kubernetes-model/labels{/name}","releases_url":"https://api.github.com/repos/fabric8io/kubernetes-model/releases{/id}","deployments_url":"https://api.github.com/repos/fabric8io/kubernetes-model/deployments","created_at":"2015-01-05T09:02:29Z","updated_at":"2018-06-27T11:08:51Z","pushed_at":"2018-06-27T13:30:18Z","git_url":"git://github.com/fabric8io/kubernetes-model.git","ssh_url":"git@github.com:fabric8io/kubernetes-model.git","clone_url":"https://github.com/fabric8io/kubernetes-model.git","svn_url":"https://github.com/fabric8io/kubernetes-model","homepage":null,"size":194017,"stargazers_count":31,"watchers_count":31,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":67,"mirror_url":null,"archived":false,"open_issues_count":19,"license":null,"forks":67,"open_issues":19,"watchers":31,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/fabric8io/kubernetes-model/pulls/312"},"html":{"href":"https://github.com/fabric8io/kubernetes-model/pull/312"},"issue":{"href":"https://api.github.com/repos/fabric8io/kubernetes-model/issues/312"},"comments":{"href":"https://api.github.com/repos/fabric8io/kubernetes-model/issues/312/comments"},"review_comments":{"href":"https://api.github.com/repos/fabric8io/kubernetes-model/pulls/312/comments"},"review_comment":{"href":"https://api.github.com/repos/fabric8io/kubernetes-model/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fabric8io/kubernetes-model/pulls/312/commits"},"statuses":{"href":"https://api.github.com/repos/fabric8io/kubernetes-model/statuses/8df00d73ccc233b22655ddf78bb4f5980ba9a7ac"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"hrishin"}}