{"action":"created","comment":{"url":"https://api.github.com/repos/clouway-incubator/xml/pulls/comments/53590598","id":53590598,"diff_hunk":"@@ -0,0 +1,107 @@\n+package com.clouway.task;\n+\n+import org.junit.Before;\n+import org.junit.Test;\n+\n+import java.io.ByteArrayInputStream;\n+import java.io.InputStream;\n+import java.nio.charset.StandardCharsets;\n+import java.util.List;\n+\n+import static org.hamcrest.CoreMatchers.equalTo;\n+import static org.hamcrest.CoreMatchers.is;\n+import static org.hamcrest.MatcherAssert.assertThat;\n+\n+/**\n+ * @author Slavi Dichkov (slavidichkof@gmail.com)\n+ */\n+public class DomParserTest {\n+    InputStream  inputStream=null;\n+    String xmlFile=\"<employees>\" +\n+            \"    <Employee>\" +\n+            \"        <firstName>Ivan</firstName>\" +\n+            \"        <lastName>Ivanov</lastName>\" +\n+            \"        <age>23</age>\" +\n+            \"        <position>mechanic</position>\" +\n+            \"        <employers>\" +\n+            \"            <Employer>\" +\n+            \"                <name>Stefan</name>\" +\n+            \"                <startDate>21-10-2010</startDate>\" +\n+            \"                <endDate>23-4-2012</endDate>\" +\n+            \"            </Employer>\" +\n+            \"            <Employer>\" +\n+            \"                <name>Ivan</name>\" +\n+            \"                <startDate>21-10-2010</startDate>\" +\n+            \"                <endDate>23-4-2012</endDate>\" +\n+            \"            </Employer>\" +\n+            \"        </employers>\" +\n+            \"        <addresses>\" +\n+            \"            <Address>\" +\n+            \"                <street>Gabrovski</street>\" +\n+            \"                <streetNo>43</streetNo>\" +\n+            \"                <section>A</section>\" +\n+            \"                <city>Veliko Tyrnovo</city>\" +\n+            \"            </Address>\" +\n+            \"        </addresses>\" +\n+            \"    </Employee>\" +\n+            \"    <Employee>\" +\n+            \"        <firstName>Kristiqn</firstName>\" +\n+            \"        <lastName>Petkov</lastName>\" +\n+            \"        <age>24</age>\" +\n+            \"        <position>programmer</position>\" +\n+            \"        <employers>\" +\n+            \"            <Employer>\" +\n+            \"                <name>Nikolai</name>\" +\n+            \"                <startDate>5-4-2015</startDate>\" +\n+            \"                <endDate>13-1-2016</endDate>\" +\n+            \"            </Employer>\" +\n+            \"            <Employer>\" +\n+            \"                <name>Ivailo</name>\" +\n+            \"                <startDate>5-4-2015</startDate>\" +\n+            \"                <endDate>13-1-2016</endDate>\" +\n+            \"            </Employer>\" +\n+            \"        </employers>\" +\n+            \"        <addresses>\" +\n+            \"            <Address>\" +\n+            \"                <street>pultava</street>\" +\n+            \"                <streetNo>12</streetNo>\" +\n+            \"                <section>B</section>\" +\n+            \"                <city>Veliko Tyrnovo</city>\" +\n+            \"            </Address>\" +\n+            \"            <Address>\" +\n+            \"                <street>pultava</street>\" +\n+            \"                <streetNo>12</streetNo>\" +\n+            \"                <section>B</section>\" +\n+            \"                <city>Veliko Tyrnovo</city>\" +\n+            \"            </Address>\" +\n+            \"        </addresses>\" +\n+            \"    </Employee>\" +\n+            \"</employees>\";\n+\n+    @Before\n+    public void setUp(){\n+        inputStream=new ByteArrayInputStream(xmlFile.getBytes(StandardCharsets.UTF_8));\n+    }\n+\n+    @Test\n+    public void pretendSameFirstNameOfInstance() {\n+        DomParser<Employee> employeeDomParser = new DomParser<>();\n+        List<Employee> employees = employeeDomParser.parse(Employee.class, inputStream);\n+        assertThat(employees.get(0).getFirstName(),is(equalTo(\"Ivan\")));","path":"tests/com/clouway/task/DomParserTest.java","position":90,"original_position":90,"commit_id":"01821ee490d848031df74c2cb60e410913319c97","original_commit_id":"c9771dd994ec13b041b110f594615ff1226d16bf","user":{"login":"tsony-tsonev","id":6035262,"avatar_url":"https://avatars.githubusercontent.com/u/6035262?v=3","gravatar_id":"","url":"https://api.github.com/users/tsony-tsonev","html_url":"https://github.com/tsony-tsonev","followers_url":"https://api.github.com/users/tsony-tsonev/followers","following_url":"https://api.github.com/users/tsony-tsonev/following{/other_user}","gists_url":"https://api.github.com/users/tsony-tsonev/gists{/gist_id}","starred_url":"https://api.github.com/users/tsony-tsonev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tsony-tsonev/subscriptions","organizations_url":"https://api.github.com/users/tsony-tsonev/orgs","repos_url":"https://api.github.com/users/tsony-tsonev/repos","events_url":"https://api.github.com/users/tsony-tsonev/events{/privacy}","received_events_url":"https://api.github.com/users/tsony-tsonev/received_events","type":"User","site_admin":false},"body":"if theese are all the fileds yep, you could also override equals and hash code and assert just the objects not field by field","created_at":"2016-02-22T06:44:21Z","updated_at":"2016-02-22T06:44:21Z","html_url":"https://github.com/clouway-incubator/xml/pull/1#discussion_r53590598","pull_request_url":"https://api.github.com/repos/clouway-incubator/xml/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/clouway-incubator/xml/pulls/comments/53590598"},"html":{"href":"https://github.com/clouway-incubator/xml/pull/1#discussion_r53590598"},"pull_request":{"href":"https://api.github.com/repos/clouway-incubator/xml/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/clouway-incubator/xml/pulls/1","id":59000952,"html_url":"https://github.com/clouway-incubator/xml/pull/1","diff_url":"https://github.com/clouway-incubator/xml/pull/1.diff","patch_url":"https://github.com/clouway-incubator/xml/pull/1.patch","issue_url":"https://api.github.com/repos/clouway-incubator/xml/issues/1","number":1,"state":"open","locked":false,"title":"xml-SAX and DOM parsers","user":{"login":"slavidichkov","id":12229758,"avatar_url":"https://avatars.githubusercontent.com/u/12229758?v=3","gravatar_id":"","url":"https://api.github.com/users/slavidichkov","html_url":"https://github.com/slavidichkov","followers_url":"https://api.github.com/users/slavidichkov/followers","following_url":"https://api.github.com/users/slavidichkov/following{/other_user}","gists_url":"https://api.github.com/users/slavidichkov/gists{/gist_id}","starred_url":"https://api.github.com/users/slavidichkov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slavidichkov/subscriptions","organizations_url":"https://api.github.com/users/slavidichkov/orgs","repos_url":"https://api.github.com/users/slavidichkov/repos","events_url":"https://api.github.com/users/slavidichkov/events{/privacy}","received_events_url":"https://api.github.com/users/slavidichkov/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-02-11T08:15:15Z","updated_at":"2016-02-22T06:44:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"792e09c7011b2207881597580b69fd0fd0865c85","assignee":{"login":"tsony-tsonev","id":6035262,"avatar_url":"https://avatars.githubusercontent.com/u/6035262?v=3","gravatar_id":"","url":"https://api.github.com/users/tsony-tsonev","html_url":"https://github.com/tsony-tsonev","followers_url":"https://api.github.com/users/tsony-tsonev/followers","following_url":"https://api.github.com/users/tsony-tsonev/following{/other_user}","gists_url":"https://api.github.com/users/tsony-tsonev/gists{/gist_id}","starred_url":"https://api.github.com/users/tsony-tsonev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tsony-tsonev/subscriptions","organizations_url":"https://api.github.com/users/tsony-tsonev/orgs","repos_url":"https://api.github.com/users/tsony-tsonev/repos","events_url":"https://api.github.com/users/tsony-tsonev/events{/privacy}","received_events_url":"https://api.github.com/users/tsony-tsonev/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/clouway-incubator/xml/pulls/1/commits","review_comments_url":"https://api.github.com/repos/clouway-incubator/xml/pulls/1/comments","review_comment_url":"https://api.github.com/repos/clouway-incubator/xml/pulls/comments{/number}","comments_url":"https://api.github.com/repos/clouway-incubator/xml/issues/1/comments","statuses_url":"https://api.github.com/repos/clouway-incubator/xml/statuses/01821ee490d848031df74c2cb60e410913319c97","head":{"label":"slavidichkov:task","ref":"task","sha":"01821ee490d848031df74c2cb60e410913319c97","user":{"login":"slavidichkov","id":12229758,"avatar_url":"https://avatars.githubusercontent.com/u/12229758?v=3","gravatar_id":"","url":"https://api.github.com/users/slavidichkov","html_url":"https://github.com/slavidichkov","followers_url":"https://api.github.com/users/slavidichkov/followers","following_url":"https://api.github.com/users/slavidichkov/following{/other_user}","gists_url":"https://api.github.com/users/slavidichkov/gists{/gist_id}","starred_url":"https://api.github.com/users/slavidichkov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slavidichkov/subscriptions","organizations_url":"https://api.github.com/users/slavidichkov/orgs","repos_url":"https://api.github.com/users/slavidichkov/repos","events_url":"https://api.github.com/users/slavidichkov/events{/privacy}","received_events_url":"https://api.github.com/users/slavidichkov/received_events","type":"User","site_admin":false},"repo":{"id":50590243,"name":"xml","full_name":"slavidichkov/xml","owner":{"login":"slavidichkov","id":12229758,"avatar_url":"https://avatars.githubusercontent.com/u/12229758?v=3","gravatar_id":"","url":"https://api.github.com/users/slavidichkov","html_url":"https://github.com/slavidichkov","followers_url":"https://api.github.com/users/slavidichkov/followers","following_url":"https://api.github.com/users/slavidichkov/following{/other_user}","gists_url":"https://api.github.com/users/slavidichkov/gists{/gist_id}","starred_url":"https://api.github.com/users/slavidichkov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slavidichkov/subscriptions","organizations_url":"https://api.github.com/users/slavidichkov/orgs","repos_url":"https://api.github.com/users/slavidichkov/repos","events_url":"https://api.github.com/users/slavidichkov/events{/privacy}","received_events_url":"https://api.github.com/users/slavidichkov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/slavidichkov/xml","description":"XML","fork":true,"url":"https://api.github.com/repos/slavidichkov/xml","forks_url":"https://api.github.com/repos/slavidichkov/xml/forks","keys_url":"https://api.github.com/repos/slavidichkov/xml/keys{/key_id}","collaborators_url":"https://api.github.com/repos/slavidichkov/xml/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/slavidichkov/xml/teams","hooks_url":"https://api.github.com/repos/slavidichkov/xml/hooks","issue_events_url":"https://api.github.com/repos/slavidichkov/xml/issues/events{/number}","events_url":"https://api.github.com/repos/slavidichkov/xml/events","assignees_url":"https://api.github.com/repos/slavidichkov/xml/assignees{/user}","branches_url":"https://api.github.com/repos/slavidichkov/xml/branches{/branch}","tags_url":"https://api.github.com/repos/slavidichkov/xml/tags","blobs_url":"https://api.github.com/repos/slavidichkov/xml/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/slavidichkov/xml/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/slavidichkov/xml/git/refs{/sha}","trees_url":"https://api.github.com/repos/slavidichkov/xml/git/trees{/sha}","statuses_url":"https://api.github.com/repos/slavidichkov/xml/statuses/{sha}","languages_url":"https://api.github.com/repos/slavidichkov/xml/languages","stargazers_url":"https://api.github.com/repos/slavidichkov/xml/stargazers","contributors_url":"https://api.github.com/repos/slavidichkov/xml/contributors","subscribers_url":"https://api.github.com/repos/slavidichkov/xml/subscribers","subscription_url":"https://api.github.com/repos/slavidichkov/xml/subscription","commits_url":"https://api.github.com/repos/slavidichkov/xml/commits{/sha}","git_commits_url":"https://api.github.com/repos/slavidichkov/xml/git/commits{/sha}","comments_url":"https://api.github.com/repos/slavidichkov/xml/comments{/number}","issue_comment_url":"https://api.github.com/repos/slavidichkov/xml/issues/comments{/number}","contents_url":"https://api.github.com/repos/slavidichkov/xml/contents/{+path}","compare_url":"https://api.github.com/repos/slavidichkov/xml/compare/{base}...{head}","merges_url":"https://api.github.com/repos/slavidichkov/xml/merges","archive_url":"https://api.github.com/repos/slavidichkov/xml/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/slavidichkov/xml/downloads","issues_url":"https://api.github.com/repos/slavidichkov/xml/issues{/number}","pulls_url":"https://api.github.com/repos/slavidichkov/xml/pulls{/number}","milestones_url":"https://api.github.com/repos/slavidichkov/xml/milestones{/number}","notifications_url":"https://api.github.com/repos/slavidichkov/xml/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/slavidichkov/xml/labels{/name}","releases_url":"https://api.github.com/repos/slavidichkov/xml/releases{/id}","deployments_url":"https://api.github.com/repos/slavidichkov/xml/deployments","created_at":"2016-01-28T14:57:20Z","updated_at":"2015-09-24T11:35:32Z","pushed_at":"2016-02-21T20:16:37Z","git_url":"git://github.com/slavidichkov/xml.git","ssh_url":"git@github.com:slavidichkov/xml.git","clone_url":"https://github.com/slavidichkov/xml.git","svn_url":"https://github.com/slavidichkov/xml","homepage":null,"size":15,"stargazers_count":0,"watchers_count":0,"language":null,"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":"clouway-incubator:slavi","ref":"slavi","sha":"8fb9ded66ba42a49701fd4715730090b327ddbae","user":{"login":"clouway-incubator","id":10173098,"avatar_url":"https://avatars.githubusercontent.com/u/10173098?v=3","gravatar_id":"","url":"https://api.github.com/users/clouway-incubator","html_url":"https://github.com/clouway-incubator","followers_url":"https://api.github.com/users/clouway-incubator/followers","following_url":"https://api.github.com/users/clouway-incubator/following{/other_user}","gists_url":"https://api.github.com/users/clouway-incubator/gists{/gist_id}","starred_url":"https://api.github.com/users/clouway-incubator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clouway-incubator/subscriptions","organizations_url":"https://api.github.com/users/clouway-incubator/orgs","repos_url":"https://api.github.com/users/clouway-incubator/repos","events_url":"https://api.github.com/users/clouway-incubator/events{/privacy}","received_events_url":"https://api.github.com/users/clouway-incubator/received_events","type":"Organization","site_admin":false},"repo":{"id":43063120,"name":"xml","full_name":"clouway-incubator/xml","owner":{"login":"clouway-incubator","id":10173098,"avatar_url":"https://avatars.githubusercontent.com/u/10173098?v=3","gravatar_id":"","url":"https://api.github.com/users/clouway-incubator","html_url":"https://github.com/clouway-incubator","followers_url":"https://api.github.com/users/clouway-incubator/followers","following_url":"https://api.github.com/users/clouway-incubator/following{/other_user}","gists_url":"https://api.github.com/users/clouway-incubator/gists{/gist_id}","starred_url":"https://api.github.com/users/clouway-incubator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clouway-incubator/subscriptions","organizations_url":"https://api.github.com/users/clouway-incubator/orgs","repos_url":"https://api.github.com/users/clouway-incubator/repos","events_url":"https://api.github.com/users/clouway-incubator/events{/privacy}","received_events_url":"https://api.github.com/users/clouway-incubator/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/clouway-incubator/xml","description":"XML","fork":false,"url":"https://api.github.com/repos/clouway-incubator/xml","forks_url":"https://api.github.com/repos/clouway-incubator/xml/forks","keys_url":"https://api.github.com/repos/clouway-incubator/xml/keys{/key_id}","collaborators_url":"https://api.github.com/repos/clouway-incubator/xml/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/clouway-incubator/xml/teams","hooks_url":"https://api.github.com/repos/clouway-incubator/xml/hooks","issue_events_url":"https://api.github.com/repos/clouway-incubator/xml/issues/events{/number}","events_url":"https://api.github.com/repos/clouway-incubator/xml/events","assignees_url":"https://api.github.com/repos/clouway-incubator/xml/assignees{/user}","branches_url":"https://api.github.com/repos/clouway-incubator/xml/branches{/branch}","tags_url":"https://api.github.com/repos/clouway-incubator/xml/tags","blobs_url":"https://api.github.com/repos/clouway-incubator/xml/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/clouway-incubator/xml/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/clouway-incubator/xml/git/refs{/sha}","trees_url":"https://api.github.com/repos/clouway-incubator/xml/git/trees{/sha}","statuses_url":"https://api.github.com/repos/clouway-incubator/xml/statuses/{sha}","languages_url":"https://api.github.com/repos/clouway-incubator/xml/languages","stargazers_url":"https://api.github.com/repos/clouway-incubator/xml/stargazers","contributors_url":"https://api.github.com/repos/clouway-incubator/xml/contributors","subscribers_url":"https://api.github.com/repos/clouway-incubator/xml/subscribers","subscription_url":"https://api.github.com/repos/clouway-incubator/xml/subscription","commits_url":"https://api.github.com/repos/clouway-incubator/xml/commits{/sha}","git_commits_url":"https://api.github.com/repos/clouway-incubator/xml/git/commits{/sha}","comments_url":"https://api.github.com/repos/clouway-incubator/xml/comments{/number}","issue_comment_url":"https://api.github.com/repos/clouway-incubator/xml/issues/comments{/number}","contents_url":"https://api.github.com/repos/clouway-incubator/xml/contents/{+path}","compare_url":"https://api.github.com/repos/clouway-incubator/xml/compare/{base}...{head}","merges_url":"https://api.github.com/repos/clouway-incubator/xml/merges","archive_url":"https://api.github.com/repos/clouway-incubator/xml/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/clouway-incubator/xml/downloads","issues_url":"https://api.github.com/repos/clouway-incubator/xml/issues{/number}","pulls_url":"https://api.github.com/repos/clouway-incubator/xml/pulls{/number}","milestones_url":"https://api.github.com/repos/clouway-incubator/xml/milestones{/number}","notifications_url":"https://api.github.com/repos/clouway-incubator/xml/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/clouway-incubator/xml/labels{/name}","releases_url":"https://api.github.com/repos/clouway-incubator/xml/releases{/id}","deployments_url":"https://api.github.com/repos/clouway-incubator/xml/deployments","created_at":"2015-09-24T11:35:32Z","updated_at":"2015-09-24T11:35:32Z","pushed_at":"2016-02-21T20:16:37Z","git_url":"git://github.com/clouway-incubator/xml.git","ssh_url":"git@github.com:clouway-incubator/xml.git","clone_url":"https://github.com/clouway-incubator/xml.git","svn_url":"https://github.com/clouway-incubator/xml","homepage":null,"size":148,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/clouway-incubator/xml/pulls/1"},"html":{"href":"https://github.com/clouway-incubator/xml/pull/1"},"issue":{"href":"https://api.github.com/repos/clouway-incubator/xml/issues/1"},"comments":{"href":"https://api.github.com/repos/clouway-incubator/xml/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/clouway-incubator/xml/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/clouway-incubator/xml/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/clouway-incubator/xml/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/clouway-incubator/xml/statuses/01821ee490d848031df74c2cb60e410913319c97"}}}}