{"action":"created","issue":{"url":"https://api.github.com/repos/camilosampedro/Aton/issues/35","repository_url":"https://api.github.com/repos/camilosampedro/Aton","labels_url":"https://api.github.com/repos/camilosampedro/Aton/issues/35/labels{/name}","comments_url":"https://api.github.com/repos/camilosampedro/Aton/issues/35/comments","events_url":"https://api.github.com/repos/camilosampedro/Aton/issues/35/events","html_url":"https://github.com/camilosampedro/Aton/pull/35","id":183261160,"number":35,"title":"fixed Play application unit tests","user":{"login":"P3trur0","id":11474157,"avatar_url":"https://avatars.githubusercontent.com/u/11474157?v=3","gravatar_id":"","url":"https://api.github.com/users/P3trur0","html_url":"https://github.com/P3trur0","followers_url":"https://api.github.com/users/P3trur0/followers","following_url":"https://api.github.com/users/P3trur0/following{/other_user}","gists_url":"https://api.github.com/users/P3trur0/gists{/gist_id}","starred_url":"https://api.github.com/users/P3trur0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/P3trur0/subscriptions","organizations_url":"https://api.github.com/users/P3trur0/orgs","repos_url":"https://api.github.com/users/P3trur0/repos","events_url":"https://api.github.com/users/P3trur0/events{/privacy}","received_events_url":"https://api.github.com/users/P3trur0/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-10-16T11:04:11Z","updated_at":"2016-10-16T17:01:53Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/camilosampedro/Aton/pulls/35","html_url":"https://github.com/camilosampedro/Aton/pull/35","diff_url":"https://github.com/camilosampedro/Aton/pull/35.diff","patch_url":"https://github.com/camilosampedro/Aton/pull/35.patch"},"body":"This commit fixes the issue #33.\r\n\r\n---\r\n\r\nIt introduces the [`BeforeAndAfterAll`](http://doc.scalatest.org/1.8/org/scalatest/BeforeAndAfterAll.html) mixin where the fake Play application is started [`beforeAll`](https://github.com/P3trur0/Aton/commit/35a4330983ebe365ee9229d62eb8855384a412b8#diff-2ed6fc412ac0935e518b83e35a6694d2R49) the tests execution and later it is shutdown [`afterAll`](https://github.com/P3trur0/Aton/commit/35a4330983ebe365ee9229d62eb8855384a412b8#diff-2ed6fc412ac0935e518b83e35a6694d2R54) the test executions.  \r\n\r\nMoreover, the test has been slightly changed to [wait the request `Future`](https://github.com/P3trur0/Aton/commit/35a4330983ebe365ee9229d62eb8855384a412b8#diff-2ed6fc412ac0935e518b83e35a6694d2R89) execution before to evaluate the actual result of the operation.  \r\n\r\n**Currently the unit test fails on my machine because it depends on a local Database configuration.**\r\n\r\nAs advice, I suggest to avoid any local database/networking connections in performing unit tests, because they could introduce side effects on the actual result of your business logic.\r\n\r\nSo I'd avoid or mock up both the Database stuff and the Networking, if any."},"comment":{"url":"https://api.github.com/repos/camilosampedro/Aton/issues/comments/254059125","html_url":"https://github.com/camilosampedro/Aton/pull/35#issuecomment-254059125","issue_url":"https://api.github.com/repos/camilosampedro/Aton/issues/35","id":254059125,"user":{"login":"P3trur0","id":11474157,"avatar_url":"https://avatars.githubusercontent.com/u/11474157?v=3","gravatar_id":"","url":"https://api.github.com/users/P3trur0","html_url":"https://github.com/P3trur0","followers_url":"https://api.github.com/users/P3trur0/followers","following_url":"https://api.github.com/users/P3trur0/following{/other_user}","gists_url":"https://api.github.com/users/P3trur0/gists{/gist_id}","starred_url":"https://api.github.com/users/P3trur0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/P3trur0/subscriptions","organizations_url":"https://api.github.com/users/P3trur0/orgs","repos_url":"https://api.github.com/users/P3trur0/repos","events_url":"https://api.github.com/users/P3trur0/events{/privacy}","received_events_url":"https://api.github.com/users/P3trur0/received_events","type":"User","site_admin":false},"created_at":"2016-10-16T17:01:53Z","updated_at":"2016-10-16T17:01:53Z","body":"@camilosampedro you're welcome.\r\nHowever the test keeps on fail, but because of business logic problems, I guess.\r\nInstead of an HTTP Status 200 it returns an HTTP Status 303:\r\n\r\n```scala\r\n[info] ComputerController\r\n\r\n16:59:28.534 [application-akka.actor.default-dispatcher-2] DEBUG application - Authenticating  [ User: User(,,None,1), Authority: 1\r\n\r\n16:59:28.546 [application-akka.actor.default-dispatcher-2] DEBUG application - Add computer request received:GET /\r\n\r\n16:59:28.665 [application-akka.actor.default-dispatcher-2] DEBUG application - Adding a new computer: Computer(127.0.0.1,Some(Localhost),aton,00000,None,None)\r\n\r\n16:59:28.727 [application-akka.actor.default-dispatcher-2] DEBUG application - Using testing cookie option, it's in development mode\r\n\r\n[info] - should add a new computer *** FAILED ***\r\n\r\n[info]   303 did not equal 200 (ComputerControllerSpec.scala:90)\r\n\r\n[info] ScalaTest\r\n```\r\n\r\n"}}
{"actor":{"display_login":"P3trur0"}}