{"action":"created","issue":{"url":"https://api.github.com/repos/jayway/powermock/issues/425","labels_url":"https://api.github.com/repos/jayway/powermock/issues/425/labels{/name}","comments_url":"https://api.github.com/repos/jayway/powermock/issues/425/comments","events_url":"https://api.github.com/repos/jayway/powermock/issues/425/events","html_url":"https://github.com/jayway/powermock/issues/425","id":97130273,"number":425,"title":"whenNew when the constructor of the class has too many arguments","user":{"login":"johanhaleby","id":187029,"avatar_url":"https://avatars.githubusercontent.com/u/187029?v=3","gravatar_id":"","url":"https://api.github.com/users/johanhaleby","html_url":"https://github.com/johanhaleby","followers_url":"https://api.github.com/users/johanhaleby/followers","following_url":"https://api.github.com/users/johanhaleby/following{/other_user}","gists_url":"https://api.github.com/users/johanhaleby/gists{/gist_id}","starred_url":"https://api.github.com/users/johanhaleby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johanhaleby/subscriptions","organizations_url":"https://api.github.com/users/johanhaleby/orgs","repos_url":"https://api.github.com/users/johanhaleby/repos","events_url":"https://api.github.com/users/johanhaleby/events{/privacy}","received_events_url":"https://api.github.com/users/johanhaleby/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jayway/powermock/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/jayway/powermock/labels/imported","name":"imported","color":"FFFFFF"},{"url":"https://api.github.com/repos/jayway/powermock/labels/Priority-Medium","name":"Priority-Medium","color":"FFFFFF"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-07-24T19:47:41Z","updated_at":"2015-07-24T19:48:21Z","closed_at":null,"body":"_From [mohamed....@gmail.com](https://code.google.com/u/113496429414382419601/) on October 25, 2012 01:42:03_\n\nSometimes, a constructor of class has a lot of arguements, in the setup of a test, we will have many lines that makes the test less readable like : \r\nPowerMockito.whenNew(A.class).withArguments(any(B.class), any(C.class), anyListOf(D.class), anyInt()).thenReturn(mockedObject);\r\n\r\nIs it possible to enhance this method to have something similar to whenNew(A.class).withNoArguments() but for the other non-default constructor ?\r\n\r\nFor example: whenNew(A.class).withAnyArguments().thenReturn(mockedObject)\n\n_Original issue: http://code.google.com/p/powermock/issues/detail?id=405_"},"comment":{"url":"https://api.github.com/repos/jayway/powermock/issues/comments/124679636","html_url":"https://github.com/jayway/powermock/issues/425#issuecomment-124679636","issue_url":"https://api.github.com/repos/jayway/powermock/issues/425","id":124679636,"user":{"login":"johanhaleby","id":187029,"avatar_url":"https://avatars.githubusercontent.com/u/187029?v=3","gravatar_id":"","url":"https://api.github.com/users/johanhaleby","html_url":"https://github.com/johanhaleby","followers_url":"https://api.github.com/users/johanhaleby/followers","following_url":"https://api.github.com/users/johanhaleby/following{/other_user}","gists_url":"https://api.github.com/users/johanhaleby/gists{/gist_id}","starred_url":"https://api.github.com/users/johanhaleby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johanhaleby/subscriptions","organizations_url":"https://api.github.com/users/johanhaleby/orgs","repos_url":"https://api.github.com/users/johanhaleby/repos","events_url":"https://api.github.com/users/johanhaleby/events{/privacy}","received_events_url":"https://api.github.com/users/johanhaleby/received_events","type":"User","site_admin":false},"created_at":"2015-07-24T19:48:21Z","updated_at":"2015-07-24T19:48:21Z","body":"_From [mohamed....@gmail.com](https://code.google.com/u/113496429414382419601/) on December 02, 2012 07:07:22_\n\nI had some problems with it, I will take a look to DelegatingToConstructorsOngoingStubbing.\r\nI will an svn update and make some tests to see if it works fine.\r\nBy the way, what about the same feature for methods as well ?\r\nSomething like :\r\nwhen(mockedObject.foo(withAnyArguments()) or when(mockedObject).foo(withAnyArguments()) ?\r\n\r\nRegards,"}}