{"action":"created","issue":{"url":"https://api.github.com/repos/google/error-prone/issues/320","labels_url":"https://api.github.com/repos/google/error-prone/issues/320/labels{/name}","comments_url":"https://api.github.com/repos/google/error-prone/issues/320/comments","events_url":"https://api.github.com/repos/google/error-prone/issues/320/events","html_url":"https://github.com/google/error-prone/pull/320","id":69808535,"number":320,"title":"Bug pattern for ensuring JMock assertions are evaluated","user":{"login":"tom-smalls","id":7118221,"avatar_url":"https://avatars.githubusercontent.com/u/7118221?v=3","gravatar_id":"","url":"https://api.github.com/users/tom-smalls","html_url":"https://github.com/tom-smalls","followers_url":"https://api.github.com/users/tom-smalls/followers","following_url":"https://api.github.com/users/tom-smalls/following{/other_user}","gists_url":"https://api.github.com/users/tom-smalls/gists{/gist_id}","starred_url":"https://api.github.com/users/tom-smalls/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tom-smalls/subscriptions","organizations_url":"https://api.github.com/users/tom-smalls/orgs","repos_url":"https://api.github.com/users/tom-smalls/repos","events_url":"https://api.github.com/users/tom-smalls/events{/privacy}","received_events_url":"https://api.github.com/users/tom-smalls/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"eaftan","id":4733401,"avatar_url":"https://avatars.githubusercontent.com/u/4733401?v=3","gravatar_id":"","url":"https://api.github.com/users/eaftan","html_url":"https://github.com/eaftan","followers_url":"https://api.github.com/users/eaftan/followers","following_url":"https://api.github.com/users/eaftan/following{/other_user}","gists_url":"https://api.github.com/users/eaftan/gists{/gist_id}","starred_url":"https://api.github.com/users/eaftan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eaftan/subscriptions","organizations_url":"https://api.github.com/users/eaftan/orgs","repos_url":"https://api.github.com/users/eaftan/repos","events_url":"https://api.github.com/users/eaftan/events{/privacy}","received_events_url":"https://api.github.com/users/eaftan/received_events","type":"User","site_admin":false},"milestone":null,"comments":4,"created_at":"2015-04-21T10:34:13Z","updated_at":"2015-05-01T11:28:25Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/google/error-prone/pulls/320","html_url":"https://github.com/google/error-prone/pull/320","diff_url":"https://github.com/google/error-prone/pull/320.diff","patch_url":"https://github.com/google/error-prone/pull/320.patch"},"body":"JMock uses a Mockery object to mock objects and to declare expectations on said mocks. If the field that holds the mockery object is not declared as a JUnit rule, or if the test does not use the JMock test runner, then this expectations are not evaluated and your tests are now passing for the wrong reasons.\r\n\r\nI've included a check for @RunWith(JMock.class) although this is now deprecated behaviour in the latest version of JMock, and several test cases for dealing with both @Rule and @RunWith.\r\n\r\nThanks,\r\n\r\nTom"},"comment":{"url":"https://api.github.com/repos/google/error-prone/issues/comments/98107588","html_url":"https://github.com/google/error-prone/pull/320#issuecomment-98107588","issue_url":"https://api.github.com/repos/google/error-prone/issues/320","id":98107588,"user":{"login":"tom-smalls","id":7118221,"avatar_url":"https://avatars.githubusercontent.com/u/7118221?v=3","gravatar_id":"","url":"https://api.github.com/users/tom-smalls","html_url":"https://github.com/tom-smalls","followers_url":"https://api.github.com/users/tom-smalls/followers","following_url":"https://api.github.com/users/tom-smalls/following{/other_user}","gists_url":"https://api.github.com/users/tom-smalls/gists{/gist_id}","starred_url":"https://api.github.com/users/tom-smalls/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tom-smalls/subscriptions","organizations_url":"https://api.github.com/users/tom-smalls/orgs","repos_url":"https://api.github.com/users/tom-smalls/repos","events_url":"https://api.github.com/users/tom-smalls/events{/privacy}","received_events_url":"https://api.github.com/users/tom-smalls/received_events","type":"User","site_admin":false},"created_at":"2015-05-01T11:28:25Z","updated_at":"2015-05-01T11:28:25Z","body":"I have reopened the pull request with the requested style and refactoring changes.\r\n\r\nI also changed the JMock matcher to see if the field is castable to Mockery as there are several implementations (most notable JUnitRuleMockery) that extend mockery that should be picked up too."}}