{"action":"created","issue":{"url":"https://api.github.com/repos/mockito/mockito/issues/438","repository_url":"https://api.github.com/repos/mockito/mockito","labels_url":"https://api.github.com/repos/mockito/mockito/issues/438/labels{/name}","comments_url":"https://api.github.com/repos/mockito/mockito/issues/438/comments","events_url":"https://api.github.com/repos/mockito/mockito/issues/438/events","html_url":"https://github.com/mockito/mockito/issues/438","id":161033974,"number":438,"title":"Add ElementType.PARAMETER to @Mock","user":{"login":"smoyer64","id":328333,"avatar_url":"https://avatars.githubusercontent.com/u/328333?v=3","gravatar_id":"","url":"https://api.github.com/users/smoyer64","html_url":"https://github.com/smoyer64","followers_url":"https://api.github.com/users/smoyer64/followers","following_url":"https://api.github.com/users/smoyer64/following{/other_user}","gists_url":"https://api.github.com/users/smoyer64/gists{/gist_id}","starred_url":"https://api.github.com/users/smoyer64/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smoyer64/subscriptions","organizations_url":"https://api.github.com/users/smoyer64/orgs","repos_url":"https://api.github.com/users/smoyer64/repos","events_url":"https://api.github.com/users/smoyer64/events{/privacy}","received_events_url":"https://api.github.com/users/smoyer64/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2016-06-18T17:10:29Z","updated_at":"2016-06-19T16:16:40Z","closed_at":null,"body":"Parameterized tests are becoming more common - JUnit 5 explicitly allows parameters and the sample [MockitoExtension](https://github.com/junit-team/junit5-samples/tree/master/junit5-mockito-extension/src/main/java/com/example/mockito) currently includes an @InjectMock to trigger the creation of a mock parameter.  It would be so much cleaner to use @Mock in both places.\r\n\r\nThis shouldn't be an issue for most legacy test systems since they don't allow test parameters (by default). \r\n\r\n"},"comment":{"url":"https://api.github.com/repos/mockito/mockito/issues/comments/227005786","html_url":"https://github.com/mockito/mockito/issues/438#issuecomment-227005786","issue_url":"https://api.github.com/repos/mockito/mockito/issues/438","id":227005786,"user":{"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},"created_at":"2016-06-19T16:16:40Z","updated_at":"2016-06-19T16:16:40Z","body":"> Would adding an annotation to the JUnit plugin not be another altivertive? I wonder if that was a cleaner solution.\r\n\r\nIntroducing a new annotation in Mockito's official JUnit 5 support is of course technically possible -- that's what our proof-of-concept `MockitoExtension` does today (i.e., we created an `@InjectMock` annotation).\r\n\r\nBut... I don't think I would call that a _cleaner solution_. IMHO, a single annotation from Mockito would be the cleanest solution since it would result in the **element of least surprise** for users of Mockito.\r\n\r\nFWIW, we have already hashed out the [exact same discussion for the Spring Framework](https://jira.spring.io/browse/SPR-14057) with regard to Spring's `@Autowired` annotation. Previously, it was not allowed to be declared on a constructor or method parameter, but we changed this for Spring 4.3.\r\n\r\n"}}
{"actor":{"display_login":"sbrannen"}}