{"action":"created","issue":{"url":"https://api.github.com/repos/emberjs/data/issues/4151","repository_url":"https://api.github.com/repos/emberjs/data","labels_url":"https://api.github.com/repos/emberjs/data/issues/4151/labels{/name}","comments_url":"https://api.github.com/repos/emberjs/data/issues/4151/comments","events_url":"https://api.github.com/repos/emberjs/data/issues/4151/events","html_url":"https://github.com/emberjs/data/issues/4151","id":132734904,"number":4151,"title":"Deprecation ember-application.injected-container triggered inside ember-data code","user":{"login":"jnfingerle","id":818498,"avatar_url":"https://avatars.githubusercontent.com/u/818498?v=3","gravatar_id":"","url":"https://api.github.com/users/jnfingerle","html_url":"https://github.com/jnfingerle","followers_url":"https://api.github.com/users/jnfingerle/followers","following_url":"https://api.github.com/users/jnfingerle/following{/other_user}","gists_url":"https://api.github.com/users/jnfingerle/gists{/gist_id}","starred_url":"https://api.github.com/users/jnfingerle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jnfingerle/subscriptions","organizations_url":"https://api.github.com/users/jnfingerle/orgs","repos_url":"https://api.github.com/users/jnfingerle/repos","events_url":"https://api.github.com/users/jnfingerle/events{/privacy}","received_events_url":"https://api.github.com/users/jnfingerle/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2016-02-10T15:43:21Z","updated_at":"2016-02-11T15:49:17Z","closed_at":null,"body":"I've got a customized set of store, adapter, and serializer classes. For testing I used a setup of those classes similar to https://github.com/emberjs/data/blob/v2.3.3/tests/helpers/store.js. When running tests in this setup (that worked fine before 2.3.*) I get\r\n\r\n> DEPRECATION: Using the injected `container` is deprecated. Please use the `getOwner` helper instead to access the owner of this object. [deprecation id: ember-application.injected-container] See http://emberjs.com/deprecations/v2.x#toc_injected-container-access for more details.\r\n>         at HANDLERS.(anonymous function) (http://localhost:4200/assets/vendor.js:16695:7)\r\n>         at raiseOnDeprecation (http://localhost:4200/assets/vendor.js:16605:12)\r\n>         at HANDLERS.(anonymous function) (http://localhost:4200/assets/vendor.js:16695:7)\r\n>         at invoke (http://localhost:4200/assets/vendor.js:16711:7)\r\n>         at deprecate (http://localhost:4200/assets/vendor.js:16664:32)\r\n>         at Object.deprecate (http://localhost:4200/assets/vendor.js:26672:37)\r\n>         at Object.defineProperty.get (http://localhost:4200/assets/vendor.js:12125:26)\r\n>         at getOwner (http://localhost:4200/assets/vendor.js:79144:22)\r\n>         at modelFactoryFor (http://localhost:4200/assets/vendor.js:78280:55) \r\n\r\nThis basically complains about https://github.com/emberjs/data/blob/v2.3.3/addon/-private/utils.js#L71 using the container (in this case caused by https://github.com/emberjs/data/blob/v2.3.3/addon/-private/system/store.js#L1530, there are different causes, but all of the referring to getOwner in utils.js).\r\n\r\nhttps://github.com/emberjs/data/blob/v2.3.3/addon/-private/utils.js#L60 promises that this polyfill won't trigger a deprecation, so I would consider that a bug. \r\n\r\nHaving said that: Is this approach to test a set of custom store, adapter and serializer as intended (and: future proof), or could you recommend a better approach that might not trigger this behaviour by e.g. returning an owner in https://github.com/emberjs/data/blob/v2.3.3/addon/-private/utils.js#L67?"},"comment":{"url":"https://api.github.com/repos/emberjs/data/issues/comments/182926170","html_url":"https://github.com/emberjs/data/issues/4151#issuecomment-182926170","issue_url":"https://api.github.com/repos/emberjs/data/issues/4151","id":182926170,"user":{"login":"rwjblue","id":12637,"avatar_url":"https://avatars.githubusercontent.com/u/12637?v=3","gravatar_id":"","url":"https://api.github.com/users/rwjblue","html_url":"https://github.com/rwjblue","followers_url":"https://api.github.com/users/rwjblue/followers","following_url":"https://api.github.com/users/rwjblue/following{/other_user}","gists_url":"https://api.github.com/users/rwjblue/gists{/gist_id}","starred_url":"https://api.github.com/users/rwjblue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rwjblue/subscriptions","organizations_url":"https://api.github.com/users/rwjblue/orgs","repos_url":"https://api.github.com/users/rwjblue/repos","events_url":"https://api.github.com/users/rwjblue/events{/privacy}","received_events_url":"https://api.github.com/users/rwjblue/received_events","type":"User","site_admin":false},"created_at":"2016-02-11T15:49:17Z","updated_at":"2016-02-11T15:49:17Z","body":"Also, just to be clear, the issue title is inferring that Ember Data is triggering deprecations in a running application which is not the case. The Ember Data testing infrastructure was causing deprecations, and that testing infrastructure is not public API..."}}