{"action":"opened","issue":{"url":"https://api.github.com/repos/jayway/powermock/issues/327","labels_url":"https://api.github.com/repos/jayway/powermock/issues/327/labels{/name}","comments_url":"https://api.github.com/repos/jayway/powermock/issues/327/comments","events_url":"https://api.github.com/repos/jayway/powermock/issues/327/events","html_url":"https://github.com/jayway/powermock/issues/327","id":97063430,"number":327,"title":"Stubbing/supressing should have precedence over mocking","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/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/jayway/powermock/labels/imported","name":"imported","color":"FFFFFF"},{"url":"https://api.github.com/repos/jayway/powermock/labels/Milestone-Release1.5","name":"Milestone-Release1.5","color":"FFFFFF"},{"url":"https://api.github.com/repos/jayway/powermock/labels/Priority-Low","name":"Priority-Low","color":"FFFFFF"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-07-24T14:19:14Z","updated_at":"2015-07-24T14:19:14Z","closed_at":null,"body":"_From [johan.ha...@gmail.com](https://code.google.com/u/105676376875942041029/) on January 03, 2011 09:43:19_\n\nThere's a bug in EasyMock that treats methods called in the ctor as mocked even though they're not. In these cases it would be good to simply be able to suppress the methods called in the ctor. But since mocking has precedence over suppressing/stubbing this is not possible. This should be an easy fix in MockGateway.\r\n\r\nHudson hudsonMockedInstance = createPartialMock(Hudson.class, new String[]{ \"getRootDir\", \"getMe\" }, new Object[]{ currentTestDirectory, (ServletContext)null }); // Here, the IllegalArgumentException is thrown, saying getExtensionList behaviour has not been defined\n\n_Original issue: http://code.google.com/p/powermock/issues/detail?id=307_"}}