{"action":"created","comment":{"url":"https://api.github.com/repos/project-ncl/pnc/pulls/comments/320151356","pull_request_review_id":282838974,"id":320151356,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDMyMDE1MTM1Ng==","diff_hunk":"@@ -0,0 +1,258 @@\n+/**\n+ * JBoss, Home of Professional Open Source.\n+ * Copyright 2014-2019 Red Hat, Inc., and individual contributors\n+ * as indicated by the @author tags.\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 org.jboss.pnc.facade.providers;\n+\n+import org.assertj.core.api.Condition;\n+import org.jboss.pnc.dto.BuildConfigurationRevision;\n+import org.jboss.pnc.dto.Environment;\n+import org.jboss.pnc.dto.SCMRepository;\n+import org.jboss.pnc.dto.response.Page;\n+import org.jboss.pnc.enums.BuildType;\n+import org.jboss.pnc.model.BuildConfiguration;\n+import org.jboss.pnc.model.BuildConfigurationAudited;\n+import org.jboss.pnc.model.BuildEnvironment;\n+import org.jboss.pnc.model.IdRev;\n+import org.jboss.pnc.model.Project;\n+import org.jboss.pnc.model.RepositoryConfiguration;\n+import org.jboss.pnc.spi.datastore.repositories.BuildConfigurationAuditedRepository;\n+import org.jboss.pnc.spi.datastore.repositories.BuildConfigurationRepository;\n+import org.jboss.pnc.spi.datastore.repositories.api.Repository;\n+import org.junit.Before;\n+import org.junit.Ignore;\n+import org.junit.Test;\n+import org.junit.runner.RunWith;\n+import org.mockito.InjectMocks;\n+import org.mockito.Mock;\n+import org.mockito.Spy;\n+import org.mockito.junit.MockitoJUnitRunner;\n+\n+import java.time.Instant;\n+import java.util.ArrayList;\n+import java.util.Arrays;\n+import java.util.Date;\n+import java.util.HashSet;\n+import java.util.List;\n+\n+import static org.assertj.core.api.Assertions.assertThat;\n+import static org.mockito.Mockito.when;\n+\n+@RunWith(MockitoJUnitRunner.class)\n+public class BuildConfigProviderTest extends AbstractProviderTest<BuildConfiguration>{\n+\n+    @Mock\n+    private BuildConfigurationRepository repository;\n+\n+    @Mock\n+    private BuildConfigurationAuditedRepository buildConfigurationAuditedRepository;\n+\n+    @Spy\n+    @InjectMocks\n+    private BuildConfigurationProviderImpl provider;\n+\n+    @Override\n+    protected AbstractProvider provider() {\n+        return provider;\n+    }\n+\n+    @Override\n+    protected Repository<BuildConfiguration, Integer> repository() {\n+        return repository;\n+    }\n+\n+    private BuildConfiguration bc = prepareBuildConfig(\"Creative\", 4, 4, 4);\n+\n+    @Before\n+    public void fill() {\n+        final BuildConfiguration a = prepareBuildConfig(\"First!\", 1, 1, 1);\n+        final BuildConfiguration b = prepareBuildConfig(\"Second!!\", 1, 2, 2, a);\n+        final BuildConfiguration c = prepareBuildConfig(\"THIRD!!!\", 2, 2, 3, a, b);\n+        final BuildConfiguration d = prepareBuildConfig(\"Fourth-_-\", 3, 3, 3, a, b, c);\n+        List<BuildConfiguration> configs = new ArrayList<>(Arrays.asList(new BuildConfiguration[] { a, b, c, d, bc }));\n+        fillRepository(configs);\n+    }\n+\n+    @Test\n+    public void testGetSpecific() {\n+        org.jboss.pnc.dto.BuildConfiguration buildConfiguration = provider.getSpecific(bc.getId().toString());\n+\n+        assertThat(buildConfiguration).isNotNull();\n+        assertThat(buildConfiguration.getId()).isEqualTo(bc.getId().toString());\n+        assertThat(buildConfiguration.getName()).isEqualTo(bc.getName());\n+    }\n+\n+    @Test\n+    public void testGetAll() {\n+        Page<org.jboss.pnc.dto.BuildConfiguration> all = provider.getAll(0, 10, null, null);\n+\n+        assertThat(all.getContent())\n+                .hasSize(5)\n+                .haveExactly(1, new Condition<>(e -> e.getName().equals(bc.getName()), \"BC Present\"));\n+    }\n+\n+    @Test\n+    public void testStore() {\n+        final String name = \"NewHire\";\n+        final String repoId = \"12\";\n+        final String envId = \"12\";\n+        final String projId = \"12\";\n+\n+        org.jboss.pnc.dto.BuildConfiguration buildConfiguration = org.jboss.pnc.dto.BuildConfiguration.builder()\n+                .name(name)\n+                .buildType(BuildType.MVN)\n+                .project(org.jboss.pnc.dto.Project.builder().id(projId).build())","path":"facade/src/test/java/org/jboss/pnc/facade/providers/BuildConfigProviderTest.java","position":117,"original_position":117,"commit_id":"a40cf8bdc065739cb3be78656822d1d455056bfb","original_commit_id":"a40cf8bdc065739cb3be78656822d1d455056bfb","user":{"login":"janinko","id":644267,"node_id":"MDQ6VXNlcjY0NDI2Nw==","avatar_url":"https://avatars2.githubusercontent.com/u/644267?v=4","gravatar_id":"","url":"https://api.github.com/users/janinko","html_url":"https://github.com/janinko","followers_url":"https://api.github.com/users/janinko/followers","following_url":"https://api.github.com/users/janinko/following{/other_user}","gists_url":"https://api.github.com/users/janinko/gists{/gist_id}","starred_url":"https://api.github.com/users/janinko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janinko/subscriptions","organizations_url":"https://api.github.com/users/janinko/orgs","repos_url":"https://api.github.com/users/janinko/repos","events_url":"https://api.github.com/users/janinko/events{/privacy}","received_events_url":"https://api.github.com/users/janinko/received_events","type":"User","site_admin":false},"body":"Wouldn't ProjectRef be technically better?","created_at":"2019-09-03T08:33:45Z","updated_at":"2019-09-03T08:41:07Z","html_url":"https://github.com/project-ncl/pnc/pull/2583#discussion_r320151356","pull_request_url":"https://api.github.com/repos/project-ncl/pnc/pulls/2583","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/project-ncl/pnc/pulls/comments/320151356"},"html":{"href":"https://github.com/project-ncl/pnc/pull/2583#discussion_r320151356"},"pull_request":{"href":"https://api.github.com/repos/project-ncl/pnc/pulls/2583"}}},"pull_request":{"url":"https://api.github.com/repos/project-ncl/pnc/pulls/2583","id":313305533,"node_id":"MDExOlB1bGxSZXF1ZXN0MzEzMzA1NTMz","html_url":"https://github.com/project-ncl/pnc/pull/2583","diff_url":"https://github.com/project-ncl/pnc/pull/2583.diff","patch_url":"https://github.com/project-ncl/pnc/pull/2583.patch","issue_url":"https://api.github.com/repos/project-ncl/pnc/issues/2583","number":2583,"state":"open","locked":false,"title":"[NCL-4996] implemented tests for BCProvider","user":{"login":"michalovjan","id":10810348,"node_id":"MDQ6VXNlcjEwODEwMzQ4","avatar_url":"https://avatars2.githubusercontent.com/u/10810348?v=4","gravatar_id":"","url":"https://api.github.com/users/michalovjan","html_url":"https://github.com/michalovjan","followers_url":"https://api.github.com/users/michalovjan/followers","following_url":"https://api.github.com/users/michalovjan/following{/other_user}","gists_url":"https://api.github.com/users/michalovjan/gists{/gist_id}","starred_url":"https://api.github.com/users/michalovjan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michalovjan/subscriptions","organizations_url":"https://api.github.com/users/michalovjan/orgs","repos_url":"https://api.github.com/users/michalovjan/repos","events_url":"https://api.github.com/users/michalovjan/events{/privacy}","received_events_url":"https://api.github.com/users/michalovjan/received_events","type":"User","site_admin":false},"body":"### Checklist:\r\n\r\n* [x] Have you added unit tests for your change?\r\n","created_at":"2019-09-02T15:22:05Z","updated_at":"2019-09-03T08:41:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"754102f910769303f08017bd9a12ead5db80f2c1","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/project-ncl/pnc/pulls/2583/commits","review_comments_url":"https://api.github.com/repos/project-ncl/pnc/pulls/2583/comments","review_comment_url":"https://api.github.com/repos/project-ncl/pnc/pulls/comments{/number}","comments_url":"https://api.github.com/repos/project-ncl/pnc/issues/2583/comments","statuses_url":"https://api.github.com/repos/project-ncl/pnc/statuses/a40cf8bdc065739cb3be78656822d1d455056bfb","head":{"label":"michalovjan:NCL-4996","ref":"NCL-4996","sha":"a40cf8bdc065739cb3be78656822d1d455056bfb","user":{"login":"michalovjan","id":10810348,"node_id":"MDQ6VXNlcjEwODEwMzQ4","avatar_url":"https://avatars2.githubusercontent.com/u/10810348?v=4","gravatar_id":"","url":"https://api.github.com/users/michalovjan","html_url":"https://github.com/michalovjan","followers_url":"https://api.github.com/users/michalovjan/followers","following_url":"https://api.github.com/users/michalovjan/following{/other_user}","gists_url":"https://api.github.com/users/michalovjan/gists{/gist_id}","starred_url":"https://api.github.com/users/michalovjan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michalovjan/subscriptions","organizations_url":"https://api.github.com/users/michalovjan/orgs","repos_url":"https://api.github.com/users/michalovjan/repos","events_url":"https://api.github.com/users/michalovjan/events{/privacy}","received_events_url":"https://api.github.com/users/michalovjan/received_events","type":"User","site_admin":false},"repo":{"id":140698564,"node_id":"MDEwOlJlcG9zaXRvcnkxNDA2OTg1NjQ=","name":"pnc","full_name":"michalovjan/pnc","private":false,"owner":{"login":"michalovjan","id":10810348,"node_id":"MDQ6VXNlcjEwODEwMzQ4","avatar_url":"https://avatars2.githubusercontent.com/u/10810348?v=4","gravatar_id":"","url":"https://api.github.com/users/michalovjan","html_url":"https://github.com/michalovjan","followers_url":"https://api.github.com/users/michalovjan/followers","following_url":"https://api.github.com/users/michalovjan/following{/other_user}","gists_url":"https://api.github.com/users/michalovjan/gists{/gist_id}","starred_url":"https://api.github.com/users/michalovjan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michalovjan/subscriptions","organizations_url":"https://api.github.com/users/michalovjan/orgs","repos_url":"https://api.github.com/users/michalovjan/repos","events_url":"https://api.github.com/users/michalovjan/events{/privacy}","received_events_url":"https://api.github.com/users/michalovjan/received_events","type":"User","site_admin":false},"html_url":"https://github.com/michalovjan/pnc","description":"System for managing, executing, and tracking builds","fork":true,"url":"https://api.github.com/repos/michalovjan/pnc","forks_url":"https://api.github.com/repos/michalovjan/pnc/forks","keys_url":"https://api.github.com/repos/michalovjan/pnc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/michalovjan/pnc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/michalovjan/pnc/teams","hooks_url":"https://api.github.com/repos/michalovjan/pnc/hooks","issue_events_url":"https://api.github.com/repos/michalovjan/pnc/issues/events{/number}","events_url":"https://api.github.com/repos/michalovjan/pnc/events","assignees_url":"https://api.github.com/repos/michalovjan/pnc/assignees{/user}","branches_url":"https://api.github.com/repos/michalovjan/pnc/branches{/branch}","tags_url":"https://api.github.com/repos/michalovjan/pnc/tags","blobs_url":"https://api.github.com/repos/michalovjan/pnc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/michalovjan/pnc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/michalovjan/pnc/git/refs{/sha}","trees_url":"https://api.github.com/repos/michalovjan/pnc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/michalovjan/pnc/statuses/{sha}","languages_url":"https://api.github.com/repos/michalovjan/pnc/languages","stargazers_url":"https://api.github.com/repos/michalovjan/pnc/stargazers","contributors_url":"https://api.github.com/repos/michalovjan/pnc/contributors","subscribers_url":"https://api.github.com/repos/michalovjan/pnc/subscribers","subscription_url":"https://api.github.com/repos/michalovjan/pnc/subscription","commits_url":"https://api.github.com/repos/michalovjan/pnc/commits{/sha}","git_commits_url":"https://api.github.com/repos/michalovjan/pnc/git/commits{/sha}","comments_url":"https://api.github.com/repos/michalovjan/pnc/comments{/number}","issue_comment_url":"https://api.github.com/repos/michalovjan/pnc/issues/comments{/number}","contents_url":"https://api.github.com/repos/michalovjan/pnc/contents/{+path}","compare_url":"https://api.github.com/repos/michalovjan/pnc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/michalovjan/pnc/merges","archive_url":"https://api.github.com/repos/michalovjan/pnc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/michalovjan/pnc/downloads","issues_url":"https://api.github.com/repos/michalovjan/pnc/issues{/number}","pulls_url":"https://api.github.com/repos/michalovjan/pnc/pulls{/number}","milestones_url":"https://api.github.com/repos/michalovjan/pnc/milestones{/number}","notifications_url":"https://api.github.com/repos/michalovjan/pnc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/michalovjan/pnc/labels{/name}","releases_url":"https://api.github.com/repos/michalovjan/pnc/releases{/id}","deployments_url":"https://api.github.com/repos/michalovjan/pnc/deployments","created_at":"2018-07-12T10:30:15Z","updated_at":"2019-03-13T12:15:45Z","pushed_at":"2019-09-02T15:21:32Z","git_url":"git://github.com/michalovjan/pnc.git","ssh_url":"git@github.com:michalovjan/pnc.git","clone_url":"https://github.com/michalovjan/pnc.git","svn_url":"https://github.com/michalovjan/pnc","homepage":"","size":21189,"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,"disabled":false,"open_issues_count":0,"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":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"project-ncl:master","ref":"master","sha":"1d4e115b9821e5c14daabb294e7dc3e16763c475","user":{"login":"project-ncl","id":9921139,"node_id":"MDEyOk9yZ2FuaXphdGlvbjk5MjExMzk=","avatar_url":"https://avatars3.githubusercontent.com/u/9921139?v=4","gravatar_id":"","url":"https://api.github.com/users/project-ncl","html_url":"https://github.com/project-ncl","followers_url":"https://api.github.com/users/project-ncl/followers","following_url":"https://api.github.com/users/project-ncl/following{/other_user}","gists_url":"https://api.github.com/users/project-ncl/gists{/gist_id}","starred_url":"https://api.github.com/users/project-ncl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/project-ncl/subscriptions","organizations_url":"https://api.github.com/users/project-ncl/orgs","repos_url":"https://api.github.com/users/project-ncl/repos","events_url":"https://api.github.com/users/project-ncl/events{/privacy}","received_events_url":"https://api.github.com/users/project-ncl/received_events","type":"Organization","site_admin":false},"repo":{"id":27052762,"node_id":"MDEwOlJlcG9zaXRvcnkyNzA1Mjc2Mg==","name":"pnc","full_name":"project-ncl/pnc","private":false,"owner":{"login":"project-ncl","id":9921139,"node_id":"MDEyOk9yZ2FuaXphdGlvbjk5MjExMzk=","avatar_url":"https://avatars3.githubusercontent.com/u/9921139?v=4","gravatar_id":"","url":"https://api.github.com/users/project-ncl","html_url":"https://github.com/project-ncl","followers_url":"https://api.github.com/users/project-ncl/followers","following_url":"https://api.github.com/users/project-ncl/following{/other_user}","gists_url":"https://api.github.com/users/project-ncl/gists{/gist_id}","starred_url":"https://api.github.com/users/project-ncl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/project-ncl/subscriptions","organizations_url":"https://api.github.com/users/project-ncl/orgs","repos_url":"https://api.github.com/users/project-ncl/repos","events_url":"https://api.github.com/users/project-ncl/events{/privacy}","received_events_url":"https://api.github.com/users/project-ncl/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/project-ncl/pnc","description":"System for managing, executing, and tracking builds","fork":false,"url":"https://api.github.com/repos/project-ncl/pnc","forks_url":"https://api.github.com/repos/project-ncl/pnc/forks","keys_url":"https://api.github.com/repos/project-ncl/pnc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/project-ncl/pnc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/project-ncl/pnc/teams","hooks_url":"https://api.github.com/repos/project-ncl/pnc/hooks","issue_events_url":"https://api.github.com/repos/project-ncl/pnc/issues/events{/number}","events_url":"https://api.github.com/repos/project-ncl/pnc/events","assignees_url":"https://api.github.com/repos/project-ncl/pnc/assignees{/user}","branches_url":"https://api.github.com/repos/project-ncl/pnc/branches{/branch}","tags_url":"https://api.github.com/repos/project-ncl/pnc/tags","blobs_url":"https://api.github.com/repos/project-ncl/pnc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/project-ncl/pnc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/project-ncl/pnc/git/refs{/sha}","trees_url":"https://api.github.com/repos/project-ncl/pnc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/project-ncl/pnc/statuses/{sha}","languages_url":"https://api.github.com/repos/project-ncl/pnc/languages","stargazers_url":"https://api.github.com/repos/project-ncl/pnc/stargazers","contributors_url":"https://api.github.com/repos/project-ncl/pnc/contributors","subscribers_url":"https://api.github.com/repos/project-ncl/pnc/subscribers","subscription_url":"https://api.github.com/repos/project-ncl/pnc/subscription","commits_url":"https://api.github.com/repos/project-ncl/pnc/commits{/sha}","git_commits_url":"https://api.github.com/repos/project-ncl/pnc/git/commits{/sha}","comments_url":"https://api.github.com/repos/project-ncl/pnc/comments{/number}","issue_comment_url":"https://api.github.com/repos/project-ncl/pnc/issues/comments{/number}","contents_url":"https://api.github.com/repos/project-ncl/pnc/contents/{+path}","compare_url":"https://api.github.com/repos/project-ncl/pnc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/project-ncl/pnc/merges","archive_url":"https://api.github.com/repos/project-ncl/pnc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/project-ncl/pnc/downloads","issues_url":"https://api.github.com/repos/project-ncl/pnc/issues{/number}","pulls_url":"https://api.github.com/repos/project-ncl/pnc/pulls{/number}","milestones_url":"https://api.github.com/repos/project-ncl/pnc/milestones{/number}","notifications_url":"https://api.github.com/repos/project-ncl/pnc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/project-ncl/pnc/labels{/name}","releases_url":"https://api.github.com/repos/project-ncl/pnc/releases{/id}","deployments_url":"https://api.github.com/repos/project-ncl/pnc/deployments","created_at":"2014-11-23T23:43:43Z","updated_at":"2019-09-02T14:31:32Z","pushed_at":"2019-09-03T02:58:34Z","git_url":"git://github.com/project-ncl/pnc.git","ssh_url":"git@github.com:project-ncl/pnc.git","clone_url":"https://github.com/project-ncl/pnc.git","svn_url":"https://github.com/project-ncl/pnc","homepage":"","size":21136,"stargazers_count":22,"watchers_count":22,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":43,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":11,"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":43,"open_issues":11,"watchers":22,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/project-ncl/pnc/pulls/2583"},"html":{"href":"https://github.com/project-ncl/pnc/pull/2583"},"issue":{"href":"https://api.github.com/repos/project-ncl/pnc/issues/2583"},"comments":{"href":"https://api.github.com/repos/project-ncl/pnc/issues/2583/comments"},"review_comments":{"href":"https://api.github.com/repos/project-ncl/pnc/pulls/2583/comments"},"review_comment":{"href":"https://api.github.com/repos/project-ncl/pnc/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/project-ncl/pnc/pulls/2583/commits"},"statuses":{"href":"https://api.github.com/repos/project-ncl/pnc/statuses/a40cf8bdc065739cb3be78656822d1d455056bfb"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"janinko"}}