{"action":"created","issue":{"url":"https://api.github.com/repos/junit-team/junit-lambda/issues/32","labels_url":"https://api.github.com/repos/junit-team/junit-lambda/issues/32/labels{/name}","comments_url":"https://api.github.com/repos/junit-team/junit-lambda/issues/32/comments","events_url":"https://api.github.com/repos/junit-team/junit-lambda/issues/32/events","html_url":"https://github.com/junit-team/junit-lambda/issues/32","id":119957704,"number":32,"title":"Should JUnit support mocking as a basic feature","user":{"login":"dinesh707","id":7288960,"avatar_url":"https://avatars.githubusercontent.com/u/7288960?v=3","gravatar_id":"","url":"https://api.github.com/users/dinesh707","html_url":"https://github.com/dinesh707","followers_url":"https://api.github.com/users/dinesh707/followers","following_url":"https://api.github.com/users/dinesh707/following{/other_user}","gists_url":"https://api.github.com/users/dinesh707/gists{/gist_id}","starred_url":"https://api.github.com/users/dinesh707/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dinesh707/subscriptions","organizations_url":"https://api.github.com/users/dinesh707/orgs","repos_url":"https://api.github.com/users/dinesh707/repos","events_url":"https://api.github.com/users/dinesh707/events{/privacy}","received_events_url":"https://api.github.com/users/dinesh707/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"sbrannen","id":104798,"avatar_url":"https://avatars.githubusercontent.com/u/104798?v=3","gravatar_id":"","url":"https://api.github.com/users/sbrannen","html_url":"https://github.com/sbrannen","followers_url":"https://api.github.com/users/sbrannen/followers","following_url":"https://api.github.com/users/sbrannen/following{/other_user}","gists_url":"https://api.github.com/users/sbrannen/gists{/gist_id}","starred_url":"https://api.github.com/users/sbrannen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbrannen/subscriptions","organizations_url":"https://api.github.com/users/sbrannen/orgs","repos_url":"https://api.github.com/users/sbrannen/repos","events_url":"https://api.github.com/users/sbrannen/events{/privacy}","received_events_url":"https://api.github.com/users/sbrannen/received_events","type":"User","site_admin":false},"milestone":null,"comments":2,"created_at":"2015-12-02T14:50:16Z","updated_at":"2015-12-02T15:15:55Z","closed_at":null,"body":"There are some object mocking frameworks available such as Mockito. Should JUnit care and give functionality to junit users to mock variables. \r\n\r\nIf it is yes, then I would like to see some form of automatic mocking mechanism for JPA meta-model like classes. But again the mocking should should be scoped for a single test. If im explaining the problem further, now when the hibernate meta models are generated they define variables as \"SingularAttribute<?,?> blah\". So each of those fields will be null on Junit testing level. So the verification will not work properly unless you first mock a value and set them."},"comment":{"url":"https://api.github.com/repos/junit-team/junit-lambda/issues/comments/161328926","html_url":"https://github.com/junit-team/junit-lambda/issues/32#issuecomment-161328926","issue_url":"https://api.github.com/repos/junit-team/junit-lambda/issues/32","id":161328926,"user":{"login":"dinesh707","id":7288960,"avatar_url":"https://avatars.githubusercontent.com/u/7288960?v=3","gravatar_id":"","url":"https://api.github.com/users/dinesh707","html_url":"https://github.com/dinesh707","followers_url":"https://api.github.com/users/dinesh707/followers","following_url":"https://api.github.com/users/dinesh707/following{/other_user}","gists_url":"https://api.github.com/users/dinesh707/gists{/gist_id}","starred_url":"https://api.github.com/users/dinesh707/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dinesh707/subscriptions","organizations_url":"https://api.github.com/users/dinesh707/orgs","repos_url":"https://api.github.com/users/dinesh707/repos","events_url":"https://api.github.com/users/dinesh707/events{/privacy}","received_events_url":"https://api.github.com/users/dinesh707/received_events","type":"User","site_admin":false},"created_at":"2015-12-02T15:15:55Z","updated_at":"2015-12-02T15:15:55Z","body":"I use '@InjectMocks' than setting them in the constructor which we don't have. But again InjectMocks will only inject fields which are annotated with '@Inject' in original class. Then in that case I need to set private methods by force using reflection which is not nice in how it looks at the end"}}