{"action":"created","comment":{"url":"https://api.github.com/repos/scala-academy/ai-game-competition/pulls/comments/195727428","pull_request_review_id":129155592,"id":195727428,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NTcyNzQyOA==","diff_hunk":"@@ -0,0 +1,310 @@\n+package server.battleship\n+\n+import org.scalatest.{Matchers, WordSpec}\n+import Grid.ShipPlacement.Direction._\n+\n+class GridSpec extends WordSpec with Matchers {\n+\n+  /*    A B C D E F G H I J\n+      1 # # # # # * * * * *\n+      2 * * * * * * * # # #\n+      3 * * * * * * * * * *\n+      4 * * * # * * * * * *\n+      5 * * * # * * * * * *\n+      6 * * * # * * * * * *\n+      7 * * * # * * * * * *\n+      8 * * * * * * * * * *\n+      9 # * * * * * * * * *\n+     10 # * * * * * * # # #\n+  */\n+\n+  val carrierP = Grid.ShipPlacement(Ship.carrier, 1, 'A', HORIZONTAL)\n+  val battleShipP = Grid.ShipPlacement(Ship.battleShip, 4, 'D', VERTICAL)\n+  val cruiserP = Grid.ShipPlacement(Ship.cruiser, 2, 'H', HORIZONTAL)\n+  val submarineP = Grid.ShipPlacement(Ship.submarine, 10, 'H', HORIZONTAL)\n+  val destroyerP = Grid.ShipPlacement(Ship.destroyer, 9, 'A', VERTICAL)\n+\n+  val correctShipPlacements = Set(carrierP, battleShipP, cruiserP, submarineP, destroyerP)\n+\n+\n+  \"Grid\" should {\n+    \"return a new grid, if the 5 ships positions are correct\" in {\n+      val _ = Grid(correctShipPlacements)\n+    }\n+\n+    \"should return error if ship number is wrong\" in {\n+      val exceptionInsufficientNumber = intercept[IllegalArgumentException] {\n+        val wrongPlacement = correctShipPlacements - carrierP\n+        val _ = Grid(wrongPlacement)\n+      }\n+      assert(exceptionInsufficientNumber.getMessage === \"requirement failed: Ship number is incorrect\")\n+\n+      val exceptionExceedingNumber = intercept[IllegalArgumentException] {\n+        val wrongPlacement = correctShipPlacements + destroyerP.copy(row = 6, col = 'G')\n+        val _ = Grid(wrongPlacement)\n+      }\n+      assert(exceptionExceedingNumber.getMessage === \"requirement failed: Ship number is incorrect\")\n+    }\n+\n+\n+    /*  A B C D E F G H I J\n+      1 * * * * * * * * * *\n+      2 * * * * * * * # # #\n+      3 * * * * * * * * * *\n+      4 * * * # * * * * * *\n+      5 # # # X # * * * * *\n+      6 * * * # * * * * * *\n+      7 * * * # * * * * * *\n+      8 * * * * * * * * * *\n+      9 # * * * * * * * * *\n+     10 # * * * * * * # # #\n+  */\n+    \"Fails to create Grid if one ship is on top of the other\" in {\n+      val exception = intercept[IllegalArgumentException] {\n+        val wrongPlacement = correctShipPlacements - carrierP + carrierP.copy(row = 5)\n+        val _ = Grid(wrongPlacement)\n+      }\n+      assert(exception.getMessage.contains(\"Set((5,D))\"))\n+\n+    }\n+\n+\n+    \"Fails to create Grid if group of ships is missing ship types\" in {\n+      val exception = intercept[IllegalArgumentException] {\n+        val wrongPlacement = correctShipPlacements - cruiserP + destroyerP.copy(row = 6, col = 'G')\n+        val _ = Grid(wrongPlacement)\n+      }\n+      assert(exception.getMessage === \"requirement failed: Not all types of ship are present\")\n+    }\n+  }\n+\n+  /*    A B C D E F G H I J\n+     1 # # # # # * * * * *\n+     2 * * * * * * * # # #\n+     3 * * * * * * * * * *\n+     4 * * * # * * * * * *\n+     5 * * * # * * * * * *\n+     6 * * * # * * * * * *\n+     7 * * * # * * * * * *\n+     8 * * * * * * * * * *\n+     9 # * * * * * * * * *\n+    10 # * * * * * * # # #\n+ */\n+  \"attack\" should {\n+    /*    A B C D E F G H I J\n+        1 # # ! # # * * * * *\n+        2 ~ * * * * * * # # #\n+        3 * * * * * * * * * *\n+        4 * * * # * * * * * *\n+        5 * * * # * * * * * *\n+        6 * * * # * * * * * *\n+        7 * * * # * * * * * *\n+        8 * * * * * * * * * *\n+        9 # * * * * * * * * *\n+       10 # * * * * * * # # #\n+    */\n+    \"return a new grid and Hit if attack is successful\" in {\n+      val hitPoint = (1, 'C')\n+      val grid = Grid(correctShipPlacements)\n+      val (newGrid, attackResult) = grid.attack(hitPoint._1, hitPoint._2)","path":"server/src/test/scala/server/battleship/GridSpec.scala","position":109,"original_position":109,"commit_id":"be3a6499d4a501f51ca01b236b23eddc6ad3469e","original_commit_id":"be3a6499d4a501f51ca01b236b23eddc6ad3469e","user":{"login":"codacy-bot","id":19940114,"node_id":"MDQ6VXNlcjE5OTQwMTE0","avatar_url":"https://avatars1.githubusercontent.com/u/19940114?v=4","gravatar_id":"","url":"https://api.github.com/users/codacy-bot","html_url":"https://github.com/codacy-bot","followers_url":"https://api.github.com/users/codacy-bot/followers","following_url":"https://api.github.com/users/codacy-bot/following{/other_user}","gists_url":"https://api.github.com/users/codacy-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/codacy-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codacy-bot/subscriptions","organizations_url":"https://api.github.com/users/codacy-bot/orgs","repos_url":"https://api.github.com/users/codacy-bot/repos","events_url":"https://api.github.com/users/codacy-bot/events{/privacy}","received_events_url":"https://api.github.com/users/codacy-bot/received_events","type":"User","site_admin":false},"body":"![Codacy](https://app.codacy.com/assets/images/favicon.png) Issue found: [Found unnamed result or parameter](https://app.codacy.com/app/scala-academy/ai-game-competition/pullRequest?prid=1762417)","created_at":"2018-06-15T13:12:29Z","updated_at":"2018-06-15T13:12:29Z","html_url":"https://github.com/scala-academy/ai-game-competition/pull/4#discussion_r195727428","pull_request_url":"https://api.github.com/repos/scala-academy/ai-game-competition/pulls/4","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/scala-academy/ai-game-competition/pulls/comments/195727428"},"html":{"href":"https://github.com/scala-academy/ai-game-competition/pull/4#discussion_r195727428"},"pull_request":{"href":"https://api.github.com/repos/scala-academy/ai-game-competition/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/scala-academy/ai-game-competition/pulls/4","id":193916400,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkzOTE2NDAw","html_url":"https://github.com/scala-academy/ai-game-competition/pull/4","diff_url":"https://github.com/scala-academy/ai-game-competition/pull/4.diff","patch_url":"https://github.com/scala-academy/ai-game-competition/pull/4.patch","issue_url":"https://api.github.com/repos/scala-academy/ai-game-competition/issues/4","number":4,"state":"open","locked":false,"title":"Feature/#1","user":{"login":"jordi133","id":6985599,"node_id":"MDQ6VXNlcjY5ODU1OTk=","avatar_url":"https://avatars0.githubusercontent.com/u/6985599?v=4","gravatar_id":"","url":"https://api.github.com/users/jordi133","html_url":"https://github.com/jordi133","followers_url":"https://api.github.com/users/jordi133/followers","following_url":"https://api.github.com/users/jordi133/following{/other_user}","gists_url":"https://api.github.com/users/jordi133/gists{/gist_id}","starred_url":"https://api.github.com/users/jordi133/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jordi133/subscriptions","organizations_url":"https://api.github.com/users/jordi133/orgs","repos_url":"https://api.github.com/users/jordi133/repos","events_url":"https://api.github.com/users/jordi133/events{/privacy}","received_events_url":"https://api.github.com/users/jordi133/received_events","type":"User","site_admin":false},"body":"Pull request for now just to trigger codacy scan","created_at":"2018-06-11T09:06:13Z","updated_at":"2018-06-15T13:12:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c88095fb1dfd5e7d6fe80cb69ccc53d24770112b","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/scala-academy/ai-game-competition/pulls/4/commits","review_comments_url":"https://api.github.com/repos/scala-academy/ai-game-competition/pulls/4/comments","review_comment_url":"https://api.github.com/repos/scala-academy/ai-game-competition/pulls/comments{/number}","comments_url":"https://api.github.com/repos/scala-academy/ai-game-competition/issues/4/comments","statuses_url":"https://api.github.com/repos/scala-academy/ai-game-competition/statuses/be3a6499d4a501f51ca01b236b23eddc6ad3469e","head":{"label":"scala-academy:feature/#1","ref":"feature/#1","sha":"be3a6499d4a501f51ca01b236b23eddc6ad3469e","user":{"login":"scala-academy","id":15196297,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE1MTk2Mjk3","avatar_url":"https://avatars2.githubusercontent.com/u/15196297?v=4","gravatar_id":"","url":"https://api.github.com/users/scala-academy","html_url":"https://github.com/scala-academy","followers_url":"https://api.github.com/users/scala-academy/followers","following_url":"https://api.github.com/users/scala-academy/following{/other_user}","gists_url":"https://api.github.com/users/scala-academy/gists{/gist_id}","starred_url":"https://api.github.com/users/scala-academy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scala-academy/subscriptions","organizations_url":"https://api.github.com/users/scala-academy/orgs","repos_url":"https://api.github.com/users/scala-academy/repos","events_url":"https://api.github.com/users/scala-academy/events{/privacy}","received_events_url":"https://api.github.com/users/scala-academy/received_events","type":"Organization","site_admin":false},"repo":{"id":132138561,"node_id":"MDEwOlJlcG9zaXRvcnkxMzIxMzg1NjE=","name":"ai-game-competition","full_name":"scala-academy/ai-game-competition","owner":{"login":"scala-academy","id":15196297,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE1MTk2Mjk3","avatar_url":"https://avatars2.githubusercontent.com/u/15196297?v=4","gravatar_id":"","url":"https://api.github.com/users/scala-academy","html_url":"https://github.com/scala-academy","followers_url":"https://api.github.com/users/scala-academy/followers","following_url":"https://api.github.com/users/scala-academy/following{/other_user}","gists_url":"https://api.github.com/users/scala-academy/gists{/gist_id}","starred_url":"https://api.github.com/users/scala-academy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scala-academy/subscriptions","organizations_url":"https://api.github.com/users/scala-academy/orgs","repos_url":"https://api.github.com/users/scala-academy/repos","events_url":"https://api.github.com/users/scala-academy/events{/privacy}","received_events_url":"https://api.github.com/users/scala-academy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/scala-academy/ai-game-competition","description":"Learning project for training Scala, Akka and Finch skills","fork":false,"url":"https://api.github.com/repos/scala-academy/ai-game-competition","forks_url":"https://api.github.com/repos/scala-academy/ai-game-competition/forks","keys_url":"https://api.github.com/repos/scala-academy/ai-game-competition/keys{/key_id}","collaborators_url":"https://api.github.com/repos/scala-academy/ai-game-competition/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/scala-academy/ai-game-competition/teams","hooks_url":"https://api.github.com/repos/scala-academy/ai-game-competition/hooks","issue_events_url":"https://api.github.com/repos/scala-academy/ai-game-competition/issues/events{/number}","events_url":"https://api.github.com/repos/scala-academy/ai-game-competition/events","assignees_url":"https://api.github.com/repos/scala-academy/ai-game-competition/assignees{/user}","branches_url":"https://api.github.com/repos/scala-academy/ai-game-competition/branches{/branch}","tags_url":"https://api.github.com/repos/scala-academy/ai-game-competition/tags","blobs_url":"https://api.github.com/repos/scala-academy/ai-game-competition/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/scala-academy/ai-game-competition/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/scala-academy/ai-game-competition/git/refs{/sha}","trees_url":"https://api.github.com/repos/scala-academy/ai-game-competition/git/trees{/sha}","statuses_url":"https://api.github.com/repos/scala-academy/ai-game-competition/statuses/{sha}","languages_url":"https://api.github.com/repos/scala-academy/ai-game-competition/languages","stargazers_url":"https://api.github.com/repos/scala-academy/ai-game-competition/stargazers","contributors_url":"https://api.github.com/repos/scala-academy/ai-game-competition/contributors","subscribers_url":"https://api.github.com/repos/scala-academy/ai-game-competition/subscribers","subscription_url":"https://api.github.com/repos/scala-academy/ai-game-competition/subscription","commits_url":"https://api.github.com/repos/scala-academy/ai-game-competition/commits{/sha}","git_commits_url":"https://api.github.com/repos/scala-academy/ai-game-competition/git/commits{/sha}","comments_url":"https://api.github.com/repos/scala-academy/ai-game-competition/comments{/number}","issue_comment_url":"https://api.github.com/repos/scala-academy/ai-game-competition/issues/comments{/number}","contents_url":"https://api.github.com/repos/scala-academy/ai-game-competition/contents/{+path}","compare_url":"https://api.github.com/repos/scala-academy/ai-game-competition/compare/{base}...{head}","merges_url":"https://api.github.com/repos/scala-academy/ai-game-competition/merges","archive_url":"https://api.github.com/repos/scala-academy/ai-game-competition/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/scala-academy/ai-game-competition/downloads","issues_url":"https://api.github.com/repos/scala-academy/ai-game-competition/issues{/number}","pulls_url":"https://api.github.com/repos/scala-academy/ai-game-competition/pulls{/number}","milestones_url":"https://api.github.com/repos/scala-academy/ai-game-competition/milestones{/number}","notifications_url":"https://api.github.com/repos/scala-academy/ai-game-competition/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/scala-academy/ai-game-competition/labels{/name}","releases_url":"https://api.github.com/repos/scala-academy/ai-game-competition/releases{/id}","deployments_url":"https://api.github.com/repos/scala-academy/ai-game-competition/deployments","created_at":"2018-05-04T12:39:52Z","updated_at":"2018-06-11T12:37:46Z","pushed_at":"2018-06-15T13:08:55Z","git_url":"git://github.com/scala-academy/ai-game-competition.git","ssh_url":"git@github.com:scala-academy/ai-game-competition.git","clone_url":"https://github.com/scala-academy/ai-game-competition.git","svn_url":"https://github.com/scala-academy/ai-game-competition","homepage":null,"size":28,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":4,"license":null,"forks":1,"open_issues":4,"watchers":0,"default_branch":"master"}},"base":{"label":"scala-academy:master","ref":"master","sha":"c1b3deb2d3b765a07d901d1b26a80a31297bf39e","user":{"login":"scala-academy","id":15196297,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE1MTk2Mjk3","avatar_url":"https://avatars2.githubusercontent.com/u/15196297?v=4","gravatar_id":"","url":"https://api.github.com/users/scala-academy","html_url":"https://github.com/scala-academy","followers_url":"https://api.github.com/users/scala-academy/followers","following_url":"https://api.github.com/users/scala-academy/following{/other_user}","gists_url":"https://api.github.com/users/scala-academy/gists{/gist_id}","starred_url":"https://api.github.com/users/scala-academy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scala-academy/subscriptions","organizations_url":"https://api.github.com/users/scala-academy/orgs","repos_url":"https://api.github.com/users/scala-academy/repos","events_url":"https://api.github.com/users/scala-academy/events{/privacy}","received_events_url":"https://api.github.com/users/scala-academy/received_events","type":"Organization","site_admin":false},"repo":{"id":132138561,"node_id":"MDEwOlJlcG9zaXRvcnkxMzIxMzg1NjE=","name":"ai-game-competition","full_name":"scala-academy/ai-game-competition","owner":{"login":"scala-academy","id":15196297,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE1MTk2Mjk3","avatar_url":"https://avatars2.githubusercontent.com/u/15196297?v=4","gravatar_id":"","url":"https://api.github.com/users/scala-academy","html_url":"https://github.com/scala-academy","followers_url":"https://api.github.com/users/scala-academy/followers","following_url":"https://api.github.com/users/scala-academy/following{/other_user}","gists_url":"https://api.github.com/users/scala-academy/gists{/gist_id}","starred_url":"https://api.github.com/users/scala-academy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scala-academy/subscriptions","organizations_url":"https://api.github.com/users/scala-academy/orgs","repos_url":"https://api.github.com/users/scala-academy/repos","events_url":"https://api.github.com/users/scala-academy/events{/privacy}","received_events_url":"https://api.github.com/users/scala-academy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/scala-academy/ai-game-competition","description":"Learning project for training Scala, Akka and Finch skills","fork":false,"url":"https://api.github.com/repos/scala-academy/ai-game-competition","forks_url":"https://api.github.com/repos/scala-academy/ai-game-competition/forks","keys_url":"https://api.github.com/repos/scala-academy/ai-game-competition/keys{/key_id}","collaborators_url":"https://api.github.com/repos/scala-academy/ai-game-competition/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/scala-academy/ai-game-competition/teams","hooks_url":"https://api.github.com/repos/scala-academy/ai-game-competition/hooks","issue_events_url":"https://api.github.com/repos/scala-academy/ai-game-competition/issues/events{/number}","events_url":"https://api.github.com/repos/scala-academy/ai-game-competition/events","assignees_url":"https://api.github.com/repos/scala-academy/ai-game-competition/assignees{/user}","branches_url":"https://api.github.com/repos/scala-academy/ai-game-competition/branches{/branch}","tags_url":"https://api.github.com/repos/scala-academy/ai-game-competition/tags","blobs_url":"https://api.github.com/repos/scala-academy/ai-game-competition/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/scala-academy/ai-game-competition/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/scala-academy/ai-game-competition/git/refs{/sha}","trees_url":"https://api.github.com/repos/scala-academy/ai-game-competition/git/trees{/sha}","statuses_url":"https://api.github.com/repos/scala-academy/ai-game-competition/statuses/{sha}","languages_url":"https://api.github.com/repos/scala-academy/ai-game-competition/languages","stargazers_url":"https://api.github.com/repos/scala-academy/ai-game-competition/stargazers","contributors_url":"https://api.github.com/repos/scala-academy/ai-game-competition/contributors","subscribers_url":"https://api.github.com/repos/scala-academy/ai-game-competition/subscribers","subscription_url":"https://api.github.com/repos/scala-academy/ai-game-competition/subscription","commits_url":"https://api.github.com/repos/scala-academy/ai-game-competition/commits{/sha}","git_commits_url":"https://api.github.com/repos/scala-academy/ai-game-competition/git/commits{/sha}","comments_url":"https://api.github.com/repos/scala-academy/ai-game-competition/comments{/number}","issue_comment_url":"https://api.github.com/repos/scala-academy/ai-game-competition/issues/comments{/number}","contents_url":"https://api.github.com/repos/scala-academy/ai-game-competition/contents/{+path}","compare_url":"https://api.github.com/repos/scala-academy/ai-game-competition/compare/{base}...{head}","merges_url":"https://api.github.com/repos/scala-academy/ai-game-competition/merges","archive_url":"https://api.github.com/repos/scala-academy/ai-game-competition/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/scala-academy/ai-game-competition/downloads","issues_url":"https://api.github.com/repos/scala-academy/ai-game-competition/issues{/number}","pulls_url":"https://api.github.com/repos/scala-academy/ai-game-competition/pulls{/number}","milestones_url":"https://api.github.com/repos/scala-academy/ai-game-competition/milestones{/number}","notifications_url":"https://api.github.com/repos/scala-academy/ai-game-competition/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/scala-academy/ai-game-competition/labels{/name}","releases_url":"https://api.github.com/repos/scala-academy/ai-game-competition/releases{/id}","deployments_url":"https://api.github.com/repos/scala-academy/ai-game-competition/deployments","created_at":"2018-05-04T12:39:52Z","updated_at":"2018-06-11T12:37:46Z","pushed_at":"2018-06-15T13:08:55Z","git_url":"git://github.com/scala-academy/ai-game-competition.git","ssh_url":"git@github.com:scala-academy/ai-game-competition.git","clone_url":"https://github.com/scala-academy/ai-game-competition.git","svn_url":"https://github.com/scala-academy/ai-game-competition","homepage":null,"size":28,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":4,"license":null,"forks":1,"open_issues":4,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/scala-academy/ai-game-competition/pulls/4"},"html":{"href":"https://github.com/scala-academy/ai-game-competition/pull/4"},"issue":{"href":"https://api.github.com/repos/scala-academy/ai-game-competition/issues/4"},"comments":{"href":"https://api.github.com/repos/scala-academy/ai-game-competition/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/scala-academy/ai-game-competition/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/scala-academy/ai-game-competition/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/scala-academy/ai-game-competition/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/scala-academy/ai-game-competition/statuses/be3a6499d4a501f51ca01b236b23eddc6ad3469e"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"codacy-bot"}}