{"action":"created","issue":{"url":"https://api.github.com/repos/playframework/playframework/issues/4316","labels_url":"https://api.github.com/repos/playframework/playframework/issues/4316/labels{/name}","comments_url":"https://api.github.com/repos/playframework/playframework/issues/4316/comments","events_url":"https://api.github.com/repos/playframework/playframework/issues/4316/events","html_url":"https://github.com/playframework/playframework/pull/4316","id":71649204,"number":4316,"title":"Allow creating an injector without creating an Application","user":{"login":"benmccann","id":322311,"avatar_url":"https://avatars.githubusercontent.com/u/322311?v=3","gravatar_id":"","url":"https://api.github.com/users/benmccann","html_url":"https://github.com/benmccann","followers_url":"https://api.github.com/users/benmccann/followers","following_url":"https://api.github.com/users/benmccann/following{/other_user}","gists_url":"https://api.github.com/users/benmccann/gists{/gist_id}","starred_url":"https://api.github.com/users/benmccann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benmccann/subscriptions","organizations_url":"https://api.github.com/users/benmccann/orgs","repos_url":"https://api.github.com/users/benmccann/repos","events_url":"https://api.github.com/users/benmccann/events{/privacy}","received_events_url":"https://api.github.com/users/benmccann/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/playframework/playframework/milestones/16","html_url":"https://github.com/playframework/playframework/milestones/2.4.0","labels_url":"https://api.github.com/repos/playframework/playframework/milestones/16/labels","id":699619,"number":16,"title":"2.4.0","description":"","creator":{"login":"jroper","id":105833,"avatar_url":"https://avatars.githubusercontent.com/u/105833?v=3","gravatar_id":"","url":"https://api.github.com/users/jroper","html_url":"https://github.com/jroper","followers_url":"https://api.github.com/users/jroper/followers","following_url":"https://api.github.com/users/jroper/following{/other_user}","gists_url":"https://api.github.com/users/jroper/gists{/gist_id}","starred_url":"https://api.github.com/users/jroper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jroper/subscriptions","organizations_url":"https://api.github.com/users/jroper/orgs","repos_url":"https://api.github.com/users/jroper/repos","events_url":"https://api.github.com/users/jroper/events{/privacy}","received_events_url":"https://api.github.com/users/jroper/received_events","type":"User","site_admin":false},"open_issues":13,"closed_issues":62,"state":"open","created_at":"2014-06-24T06:48:17Z","updated_at":"2015-04-28T22:44:41Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2015-04-28T17:17:54Z","updated_at":"2015-04-29T01:05:09Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/playframework/playframework/pulls/4316","html_url":"https://github.com/playframework/playframework/pull/4316","diff_url":"https://github.com/playframework/playframework/pull/4316.diff","patch_url":"https://github.com/playframework/playframework/pull/4316.patch"},"body":"All of the fields in my tests are injected. I've gotten stuck on migrating to 2.4 when I got to my tests because it seems that Play 2.4 isn't really setup to have injectable tests. In Guice 3 you'd typically use something like [Guiceberry](https://code.google.com/p/guiceberry/) and [in Guice 4 you'd typically use Guice's built-in BoundFieldModule](https://github.com/google/guice/wiki/BoundFields). The typical setup is that you create an injector which injects the tests. The problem is that in Play 2.4 the Injector is hidden within the ApplicationLoader.\r\n\r\nThis PR helps by making the injector less hidden in the internals. You can see in fact that many of the existing tests had to inject an entire application and then get the injector from it to then inject some other object instead of being able to inject that object directly.\r\n\r\nIdeally Guice 4 will be released before Play 2.4. In that case I'd really love to add a documentation example showing how to write a test with BoundFieldModule."},"comment":{"url":"https://api.github.com/repos/playframework/playframework/issues/comments/97277762","html_url":"https://github.com/playframework/playframework/pull/4316#issuecomment-97277762","issue_url":"https://api.github.com/repos/playframework/playframework/issues/4316","id":97277762,"user":{"login":"jroper","id":105833,"avatar_url":"https://avatars.githubusercontent.com/u/105833?v=3","gravatar_id":"","url":"https://api.github.com/users/jroper","html_url":"https://github.com/jroper","followers_url":"https://api.github.com/users/jroper/followers","following_url":"https://api.github.com/users/jroper/following{/other_user}","gists_url":"https://api.github.com/users/jroper/gists{/gist_id}","starred_url":"https://api.github.com/users/jroper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jroper/subscriptions","organizations_url":"https://api.github.com/users/jroper/orgs","repos_url":"https://api.github.com/users/jroper/repos","events_url":"https://api.github.com/users/jroper/events{/privacy}","received_events_url":"https://api.github.com/users/jroper/received_events","type":"User","site_admin":false},"created_at":"2015-04-29T01:05:09Z","updated_at":"2015-04-29T01:05:09Z","body":"Isn't this already somewhat addressed by [`GuiceInjectorBuilder`](https://playframework.com/documentation/2.4.x/api/java/play/inject/guice/GuiceInjectorBuilder.html)?"}}