{"action":"created","issue":{"url":"https://api.github.com/repos/spockframework/spock/issues/86","repository_url":"https://api.github.com/repos/spockframework/spock","labels_url":"https://api.github.com/repos/spockframework/spock/issues/86/labels{/name}","comments_url":"https://api.github.com/repos/spockframework/spock/issues/86/comments","events_url":"https://api.github.com/repos/spockframework/spock/issues/86/events","html_url":"https://github.com/spockframework/spock/issues/86","id":75796626,"number":86,"title":"Ability to inject Spock mocks as Spring beans","user":{"login":"chrylis","id":2394512,"avatar_url":"https://avatars.githubusercontent.com/u/2394512?v=3","gravatar_id":"","url":"https://api.github.com/users/chrylis","html_url":"https://github.com/chrylis","followers_url":"https://api.github.com/users/chrylis/followers","following_url":"https://api.github.com/users/chrylis/following{/other_user}","gists_url":"https://api.github.com/users/chrylis/gists{/gist_id}","starred_url":"https://api.github.com/users/chrylis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrylis/subscriptions","organizations_url":"https://api.github.com/users/chrylis/orgs","repos_url":"https://api.github.com/users/chrylis/repos","events_url":"https://api.github.com/users/chrylis/events{/privacy}","received_events_url":"https://api.github.com/users/chrylis/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/spockframework/spock/labels/new%20feature","name":"new feature","color":"0052cc"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2015-05-13T00:55:57Z","updated_at":"2016-08-08T21:42:35Z","closed_at":null,"body":"There was an issue on the old tracker referenced in [this SO question](http://stackoverflow.com/questions/16810646/how-to-create-spock-mocks-outside-of-a-specification-class) that doesn't appear to have been migrated. Essentially, for tests that require starting up a nontrivial application context, it would be extremely helpful to be able to create a Spock mock and easily register it as a Spring bean (especially when using Spring Boot for testing)."},"comment":{"url":"https://api.github.com/repos/spockframework/spock/issues/comments/238386992","html_url":"https://github.com/spockframework/spock/issues/86#issuecomment-238386992","issue_url":"https://api.github.com/repos/spockframework/spock/issues/86","id":238386992,"user":{"login":"leonard84","id":1151511,"avatar_url":"https://avatars.githubusercontent.com/u/1151511?v=3","gravatar_id":"","url":"https://api.github.com/users/leonard84","html_url":"https://github.com/leonard84","followers_url":"https://api.github.com/users/leonard84/followers","following_url":"https://api.github.com/users/leonard84/following{/other_user}","gists_url":"https://api.github.com/users/leonard84/gists{/gist_id}","starred_url":"https://api.github.com/users/leonard84/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leonard84/subscriptions","organizations_url":"https://api.github.com/users/leonard84/orgs","repos_url":"https://api.github.com/users/leonard84/repos","events_url":"https://api.github.com/users/leonard84/events{/privacy}","received_events_url":"https://api.github.com/users/leonard84/received_events","type":"User","site_admin":false},"created_at":"2016-08-08T21:42:35Z","updated_at":"2016-08-08T21:42:35Z","body":"@jgriff spock-1.1-rc1 already includes detached mock support.\r\n\r\nIn regards to `@MockBean` my comment above still holds AFAIK. If it is replacing beans in an already created application context it needs to recreate all beans that have dependencies on it and the context is only valid for this one class. This disables cached-context reuse between test classes which can have a serious impact on your test run times.\r\nHowever, I haven't looked too deeply into the actual implementation and if they somehow got around that, then maybe we can adopt it for spock mocks as well."}}
{"actor":{"display_login":"leonard84"}}