{"action":"created","comment":{"url":"https://api.github.com/repos/arquillian/arquillian-cube/pulls/comments/73848578","id":73848578,"diff_hunk":"@@ -0,0 +1,134 @@\n+package org.arquillian.cube.docker.impl.client.reporter;\n+\n+import com.github.dockerjava.api.model.Version;\n+import org.arquillian.cube.docker.impl.client.CubeDockerConfiguration;\n+import org.arquillian.cube.docker.impl.docker.DockerClientExecutor;\n+import org.arquillian.cube.spi.event.lifecycle.AfterAutoStart;\n+import org.arquillian.recorder.reporter.PropertyEntry;\n+import org.arquillian.recorder.reporter.ReporterConfiguration;\n+import org.arquillian.recorder.reporter.event.PropertyReportEvent;\n+import org.arquillian.recorder.reporter.model.entry.GroupEntry;\n+import org.arquillian.recorder.reporter.model.entry.KeyValueEntry;\n+import org.arquillian.recorder.reporter.model.entry.ScreenshotEntry;\n+import org.jboss.arquillian.core.api.Event;\n+import org.junit.Before;\n+import org.junit.Test;\n+import org.junit.runner.RunWith;\n+import org.mockito.ArgumentCaptor;\n+import org.mockito.Captor;\n+import org.mockito.Mock;\n+import org.mockito.runners.MockitoJUnitRunner;\n+\n+import java.util.HashMap;\n+import java.util.List;\n+import java.util.Map;\n+\n+import static org.assertj.core.api.Assertions.assertThat;\n+import static org.mockito.Mockito.verify;\n+import static org.mockito.Mockito.when;\n+\n+@RunWith(MockitoJUnitRunner.class)\n+public class TakeDockerEnvironmentTest {\n+\n+    private static final String MULTIPLE_PORT_BINDING_SCENARIO =\n+            \"helloworld:\\n\" +\n+            \"  image: dockercloud/hello-world\\n\" +\n+            \"  exposedPorts: [8089/tcp]\\n\" +\n+            \"  networkMode: host\\n\" +\n+            \"  portBindings: [8080->80/tcp, 8081->81/tcp]\";\n+\n+    @Mock\n+    DockerClientExecutor dockerClientExecutor;\n+\n+    @Mock\n+    Version version;\n+\n+    @Mock\n+    Event<PropertyReportEvent> propertyReportEvent;\n+\n+    @Captor\n+    ArgumentCaptor<PropertyReportEvent> propertyReportEventArgumentCaptor;\n+\n+    @Before\n+    public void configureDockerExecutor() {\n+        when(version.getVersion()).thenReturn(\"1.1.0\");\n+        when(version.getOperatingSystem()).thenReturn(\"linux\");\n+        when(version.getKernelVersion()).thenReturn(\"3.1.0\");\n+        when(version.getApiVersion()).thenReturn(\"1.12\");\n+        when(version.getArch()).thenReturn(\"x86\");\n+        when(dockerClientExecutor.dockerHostVersion()).thenReturn(version);\n+    }\n+\n+    @Test\n+    public void should_report_docker_version() {\n+        final TakeDockerEnvironment takeDockerEnvironment = new TakeDockerEnvironment();\n+        takeDockerEnvironment.propertyReportEvent = propertyReportEvent;\n+\n+        Map<String, String> configuration = new HashMap<>();\n+        configuration.put(CubeDockerConfiguration.DOCKER_CONTAINERS, MULTIPLE_PORT_BINDING_SCENARIO);\n+\n+        takeDockerEnvironment.reportDockerEnvironment(new AfterAutoStart(), CubeDockerConfiguration.fromMap(configuration, null), dockerClientExecutor, new ReporterConfiguration());\n+\n+        verify(propertyReportEvent).fire(propertyReportEventArgumentCaptor.capture());\n+\n+        final PropertyReportEvent propertyReportEvent = propertyReportEventArgumentCaptor.getValue();\n+        final PropertyEntry propertyEntry = propertyReportEvent.getPropertyEntry();\n+        assertThat(propertyEntry).isInstanceOf(GroupEntry.class);\n+\n+        GroupEntry parent = (GroupEntry) propertyEntry;\n+        final List<PropertyEntry> rootEntries = parent.getPropertyEntries();\n+        assertThat(rootEntries).hasSize(2);\n+\n+        final PropertyEntry propertyDockerInfoEntry = rootEntries.get(0);\n+        assertThat(propertyDockerInfoEntry).isInstanceOf(GroupEntry.class);\n+\n+        GroupEntry dockerInfoEntry = (GroupEntry) propertyDockerInfoEntry;\n+        final List<PropertyEntry> propertyEntries = dockerInfoEntry.getPropertyEntries();\n+\n+        assertThat(propertyEntries).hasSize(5);\n+\n+        assertThat(propertyEntries.get(0)).isEqualToComparingFieldByField(new KeyValueEntry(\"Version\", \"1.1.0\"));\n+        assertThat(propertyEntries.get(1)).isEqualToComparingFieldByField(new KeyValueEntry(\"OS\", \"linux\"));","path":"docker/recorder/src/test/java/org/arquillian/cube/docker/impl/client/reporter/TakeDockerEnvironmentTest.java","position":91,"original_position":91,"commit_id":"f543fd2b311f1338d85db37c52ef10f3c7368c03","original_commit_id":"f543fd2b311f1338d85db37c52ef10f3c7368c03","user":{"login":"bartoszmajsak","id":719616,"avatar_url":"https://avatars.githubusercontent.com/u/719616?v=3","gravatar_id":"","url":"https://api.github.com/users/bartoszmajsak","html_url":"https://github.com/bartoszmajsak","followers_url":"https://api.github.com/users/bartoszmajsak/followers","following_url":"https://api.github.com/users/bartoszmajsak/following{/other_user}","gists_url":"https://api.github.com/users/bartoszmajsak/gists{/gist_id}","starred_url":"https://api.github.com/users/bartoszmajsak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bartoszmajsak/subscriptions","organizations_url":"https://api.github.com/users/bartoszmajsak/orgs","repos_url":"https://api.github.com/users/bartoszmajsak/repos","events_url":"https://api.github.com/users/bartoszmajsak/events{/privacy}","received_events_url":"https://api.github.com/users/bartoszmajsak/received_events","type":"User","site_admin":false},"body":"Then maybe we should bring them? WDYT?","created_at":"2016-08-08T09:45:47Z","updated_at":"2016-08-08T09:45:47Z","html_url":"https://github.com/arquillian/arquillian-cube/pull/412#discussion_r73848578","pull_request_url":"https://api.github.com/repos/arquillian/arquillian-cube/pulls/412","_links":{"self":{"href":"https://api.github.com/repos/arquillian/arquillian-cube/pulls/comments/73848578"},"html":{"href":"https://github.com/arquillian/arquillian-cube/pull/412#discussion_r73848578"},"pull_request":{"href":"https://api.github.com/repos/arquillian/arquillian-cube/pulls/412"}}},"pull_request":{"url":"https://api.github.com/repos/arquillian/arquillian-cube/pulls/412","id":80250980,"html_url":"https://github.com/arquillian/arquillian-cube/pull/412","diff_url":"https://github.com/arquillian/arquillian-cube/pull/412.diff","patch_url":"https://github.com/arquillian/arquillian-cube/pull/412.patch","issue_url":"https://api.github.com/repos/arquillian/arquillian-cube/issues/412","number":412,"state":"open","locked":false,"title":"[issue #287] adds Arquillian Recorder Reporter integration","user":{"login":"lordofthejars","id":1517153,"avatar_url":"https://avatars.githubusercontent.com/u/1517153?v=3","gravatar_id":"","url":"https://api.github.com/users/lordofthejars","html_url":"https://github.com/lordofthejars","followers_url":"https://api.github.com/users/lordofthejars/followers","following_url":"https://api.github.com/users/lordofthejars/following{/other_user}","gists_url":"https://api.github.com/users/lordofthejars/gists{/gist_id}","starred_url":"https://api.github.com/users/lordofthejars/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lordofthejars/subscriptions","organizations_url":"https://api.github.com/users/lordofthejars/orgs","repos_url":"https://api.github.com/users/lordofthejars/repos","events_url":"https://api.github.com/users/lordofthejars/events{/privacy}","received_events_url":"https://api.github.com/users/lordofthejars/received_events","type":"User","site_admin":false},"body":"\n\n<!-- Reviewable:start -->\nThis change is [<img src=\"https://reviewable.io/review_button.svg\" height=\"34\" align=\"absmiddle\" alt=\"Reviewable\"/>](https://reviewable.io/reviews/arquillian/arquillian-cube/412)\n<!-- Reviewable:end -->\n","created_at":"2016-08-05T14:20:32Z","updated_at":"2016-08-08T09:45:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"98e49294d76f11d35b5ff0bbe905f6cecc88c10c","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/arquillian/arquillian-cube/pulls/412/commits","review_comments_url":"https://api.github.com/repos/arquillian/arquillian-cube/pulls/412/comments","review_comment_url":"https://api.github.com/repos/arquillian/arquillian-cube/pulls/comments{/number}","comments_url":"https://api.github.com/repos/arquillian/arquillian-cube/issues/412/comments","statuses_url":"https://api.github.com/repos/arquillian/arquillian-cube/statuses/f543fd2b311f1338d85db37c52ef10f3c7368c03","head":{"label":"lordofthejars:issue-287","ref":"issue-287","sha":"f543fd2b311f1338d85db37c52ef10f3c7368c03","user":{"login":"lordofthejars","id":1517153,"avatar_url":"https://avatars.githubusercontent.com/u/1517153?v=3","gravatar_id":"","url":"https://api.github.com/users/lordofthejars","html_url":"https://github.com/lordofthejars","followers_url":"https://api.github.com/users/lordofthejars/followers","following_url":"https://api.github.com/users/lordofthejars/following{/other_user}","gists_url":"https://api.github.com/users/lordofthejars/gists{/gist_id}","starred_url":"https://api.github.com/users/lordofthejars/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lordofthejars/subscriptions","organizations_url":"https://api.github.com/users/lordofthejars/orgs","repos_url":"https://api.github.com/users/lordofthejars/repos","events_url":"https://api.github.com/users/lordofthejars/events{/privacy}","received_events_url":"https://api.github.com/users/lordofthejars/received_events","type":"User","site_admin":false},"repo":{"id":49945362,"name":"arquillian-cube","full_name":"lordofthejars/arquillian-cube","owner":{"login":"lordofthejars","id":1517153,"avatar_url":"https://avatars.githubusercontent.com/u/1517153?v=3","gravatar_id":"","url":"https://api.github.com/users/lordofthejars","html_url":"https://github.com/lordofthejars","followers_url":"https://api.github.com/users/lordofthejars/followers","following_url":"https://api.github.com/users/lordofthejars/following{/other_user}","gists_url":"https://api.github.com/users/lordofthejars/gists{/gist_id}","starred_url":"https://api.github.com/users/lordofthejars/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lordofthejars/subscriptions","organizations_url":"https://api.github.com/users/lordofthejars/orgs","repos_url":"https://api.github.com/users/lordofthejars/repos","events_url":"https://api.github.com/users/lordofthejars/events{/privacy}","received_events_url":"https://api.github.com/users/lordofthejars/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lordofthejars/arquillian-cube","description":"Arquillian Docker","fork":true,"url":"https://api.github.com/repos/lordofthejars/arquillian-cube","forks_url":"https://api.github.com/repos/lordofthejars/arquillian-cube/forks","keys_url":"https://api.github.com/repos/lordofthejars/arquillian-cube/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lordofthejars/arquillian-cube/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lordofthejars/arquillian-cube/teams","hooks_url":"https://api.github.com/repos/lordofthejars/arquillian-cube/hooks","issue_events_url":"https://api.github.com/repos/lordofthejars/arquillian-cube/issues/events{/number}","events_url":"https://api.github.com/repos/lordofthejars/arquillian-cube/events","assignees_url":"https://api.github.com/repos/lordofthejars/arquillian-cube/assignees{/user}","branches_url":"https://api.github.com/repos/lordofthejars/arquillian-cube/branches{/branch}","tags_url":"https://api.github.com/repos/lordofthejars/arquillian-cube/tags","blobs_url":"https://api.github.com/repos/lordofthejars/arquillian-cube/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lordofthejars/arquillian-cube/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lordofthejars/arquillian-cube/git/refs{/sha}","trees_url":"https://api.github.com/repos/lordofthejars/arquillian-cube/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lordofthejars/arquillian-cube/statuses/{sha}","languages_url":"https://api.github.com/repos/lordofthejars/arquillian-cube/languages","stargazers_url":"https://api.github.com/repos/lordofthejars/arquillian-cube/stargazers","contributors_url":"https://api.github.com/repos/lordofthejars/arquillian-cube/contributors","subscribers_url":"https://api.github.com/repos/lordofthejars/arquillian-cube/subscribers","subscription_url":"https://api.github.com/repos/lordofthejars/arquillian-cube/subscription","commits_url":"https://api.github.com/repos/lordofthejars/arquillian-cube/commits{/sha}","git_commits_url":"https://api.github.com/repos/lordofthejars/arquillian-cube/git/commits{/sha}","comments_url":"https://api.github.com/repos/lordofthejars/arquillian-cube/comments{/number}","issue_comment_url":"https://api.github.com/repos/lordofthejars/arquillian-cube/issues/comments{/number}","contents_url":"https://api.github.com/repos/lordofthejars/arquillian-cube/contents/{+path}","compare_url":"https://api.github.com/repos/lordofthejars/arquillian-cube/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lordofthejars/arquillian-cube/merges","archive_url":"https://api.github.com/repos/lordofthejars/arquillian-cube/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lordofthejars/arquillian-cube/downloads","issues_url":"https://api.github.com/repos/lordofthejars/arquillian-cube/issues{/number}","pulls_url":"https://api.github.com/repos/lordofthejars/arquillian-cube/pulls{/number}","milestones_url":"https://api.github.com/repos/lordofthejars/arquillian-cube/milestones{/number}","notifications_url":"https://api.github.com/repos/lordofthejars/arquillian-cube/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lordofthejars/arquillian-cube/labels{/name}","releases_url":"https://api.github.com/repos/lordofthejars/arquillian-cube/releases{/id}","deployments_url":"https://api.github.com/repos/lordofthejars/arquillian-cube/deployments","created_at":"2016-01-19T10:32:41Z","updated_at":"2016-01-19T10:32:42Z","pushed_at":"2016-08-05T14:20:23Z","git_url":"git://github.com/lordofthejars/arquillian-cube.git","ssh_url":"git@github.com:lordofthejars/arquillian-cube.git","clone_url":"https://github.com/lordofthejars/arquillian-cube.git","svn_url":"https://github.com/lordofthejars/arquillian-cube","homepage":null,"size":1347,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"arquillian:master","ref":"master","sha":"24836f0eff93824325f7d965f61fdfbe8203af23","user":{"login":"arquillian","id":330981,"avatar_url":"https://avatars.githubusercontent.com/u/330981?v=3","gravatar_id":"","url":"https://api.github.com/users/arquillian","html_url":"https://github.com/arquillian","followers_url":"https://api.github.com/users/arquillian/followers","following_url":"https://api.github.com/users/arquillian/following{/other_user}","gists_url":"https://api.github.com/users/arquillian/gists{/gist_id}","starred_url":"https://api.github.com/users/arquillian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arquillian/subscriptions","organizations_url":"https://api.github.com/users/arquillian/orgs","repos_url":"https://api.github.com/users/arquillian/repos","events_url":"https://api.github.com/users/arquillian/events{/privacy}","received_events_url":"https://api.github.com/users/arquillian/received_events","type":"Organization","site_admin":false},"repo":{"id":25573964,"name":"arquillian-cube","full_name":"arquillian/arquillian-cube","owner":{"login":"arquillian","id":330981,"avatar_url":"https://avatars.githubusercontent.com/u/330981?v=3","gravatar_id":"","url":"https://api.github.com/users/arquillian","html_url":"https://github.com/arquillian","followers_url":"https://api.github.com/users/arquillian/followers","following_url":"https://api.github.com/users/arquillian/following{/other_user}","gists_url":"https://api.github.com/users/arquillian/gists{/gist_id}","starred_url":"https://api.github.com/users/arquillian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arquillian/subscriptions","organizations_url":"https://api.github.com/users/arquillian/orgs","repos_url":"https://api.github.com/users/arquillian/repos","events_url":"https://api.github.com/users/arquillian/events{/privacy}","received_events_url":"https://api.github.com/users/arquillian/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/arquillian/arquillian-cube","description":"Arquillian Docker","fork":false,"url":"https://api.github.com/repos/arquillian/arquillian-cube","forks_url":"https://api.github.com/repos/arquillian/arquillian-cube/forks","keys_url":"https://api.github.com/repos/arquillian/arquillian-cube/keys{/key_id}","collaborators_url":"https://api.github.com/repos/arquillian/arquillian-cube/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/arquillian/arquillian-cube/teams","hooks_url":"https://api.github.com/repos/arquillian/arquillian-cube/hooks","issue_events_url":"https://api.github.com/repos/arquillian/arquillian-cube/issues/events{/number}","events_url":"https://api.github.com/repos/arquillian/arquillian-cube/events","assignees_url":"https://api.github.com/repos/arquillian/arquillian-cube/assignees{/user}","branches_url":"https://api.github.com/repos/arquillian/arquillian-cube/branches{/branch}","tags_url":"https://api.github.com/repos/arquillian/arquillian-cube/tags","blobs_url":"https://api.github.com/repos/arquillian/arquillian-cube/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/arquillian/arquillian-cube/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/arquillian/arquillian-cube/git/refs{/sha}","trees_url":"https://api.github.com/repos/arquillian/arquillian-cube/git/trees{/sha}","statuses_url":"https://api.github.com/repos/arquillian/arquillian-cube/statuses/{sha}","languages_url":"https://api.github.com/repos/arquillian/arquillian-cube/languages","stargazers_url":"https://api.github.com/repos/arquillian/arquillian-cube/stargazers","contributors_url":"https://api.github.com/repos/arquillian/arquillian-cube/contributors","subscribers_url":"https://api.github.com/repos/arquillian/arquillian-cube/subscribers","subscription_url":"https://api.github.com/repos/arquillian/arquillian-cube/subscription","commits_url":"https://api.github.com/repos/arquillian/arquillian-cube/commits{/sha}","git_commits_url":"https://api.github.com/repos/arquillian/arquillian-cube/git/commits{/sha}","comments_url":"https://api.github.com/repos/arquillian/arquillian-cube/comments{/number}","issue_comment_url":"https://api.github.com/repos/arquillian/arquillian-cube/issues/comments{/number}","contents_url":"https://api.github.com/repos/arquillian/arquillian-cube/contents/{+path}","compare_url":"https://api.github.com/repos/arquillian/arquillian-cube/compare/{base}...{head}","merges_url":"https://api.github.com/repos/arquillian/arquillian-cube/merges","archive_url":"https://api.github.com/repos/arquillian/arquillian-cube/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/arquillian/arquillian-cube/downloads","issues_url":"https://api.github.com/repos/arquillian/arquillian-cube/issues{/number}","pulls_url":"https://api.github.com/repos/arquillian/arquillian-cube/pulls{/number}","milestones_url":"https://api.github.com/repos/arquillian/arquillian-cube/milestones{/number}","notifications_url":"https://api.github.com/repos/arquillian/arquillian-cube/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/arquillian/arquillian-cube/labels{/name}","releases_url":"https://api.github.com/repos/arquillian/arquillian-cube/releases{/id}","deployments_url":"https://api.github.com/repos/arquillian/arquillian-cube/deployments","created_at":"2014-10-22T09:47:10Z","updated_at":"2016-06-30T12:38:55Z","pushed_at":"2016-08-06T20:04:33Z","git_url":"git://github.com/arquillian/arquillian-cube.git","ssh_url":"git@github.com:arquillian/arquillian-cube.git","clone_url":"https://github.com/arquillian/arquillian-cube.git","svn_url":"https://github.com/arquillian/arquillian-cube","homepage":null,"size":1465,"stargazers_count":45,"watchers_count":45,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":39,"mirror_url":null,"open_issues_count":37,"forks":39,"open_issues":37,"watchers":45,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/arquillian/arquillian-cube/pulls/412"},"html":{"href":"https://github.com/arquillian/arquillian-cube/pull/412"},"issue":{"href":"https://api.github.com/repos/arquillian/arquillian-cube/issues/412"},"comments":{"href":"https://api.github.com/repos/arquillian/arquillian-cube/issues/412/comments"},"review_comments":{"href":"https://api.github.com/repos/arquillian/arquillian-cube/pulls/412/comments"},"review_comment":{"href":"https://api.github.com/repos/arquillian/arquillian-cube/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/arquillian/arquillian-cube/pulls/412/commits"},"statuses":{"href":"https://api.github.com/repos/arquillian/arquillian-cube/statuses/f543fd2b311f1338d85db37c52ef10f3c7368c03"}}}}
{"actor":{"display_login":"bartoszmajsak"}}