{"action":"created","issue":{"url":"https://api.github.com/repos/jayway/powermock/issues/282","labels_url":"https://api.github.com/repos/jayway/powermock/issues/282/labels{/name}","comments_url":"https://api.github.com/repos/jayway/powermock/issues/282/comments","events_url":"https://api.github.com/repos/jayway/powermock/issues/282/events","html_url":"https://github.com/jayway/powermock/issues/282","id":96975562,"number":282,"title":"Error while mocking Static method","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"},{"url":"https://api.github.com/repos/jayway/powermock/labels/wontfix","name":"wontfix","color":"ffffff"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-24T06:30:26Z","updated_at":"2015-07-24T06:30:27Z","closed_at":null,"body":"_From [vichhu...@yahoo.com](https://code.google.com/u/104162302400230282206/) on June 10, 2010 09:22:10_\n\nI am using 1.2.5 version of power mock\r\n\r\nThe operating system is windows.\r\n\r\nI have attached the error, which i am getting while trying to mock a static method, which looks like:\r\n\r\npublic class YUtil extends Xutil{\r\n public static Long getPort(Long serviceid) throws Exception{\r\n       Long cellEndPort = Xutil.getPortsForCircuit(circuitId);\r\n }\r\n}\r\n\r\nI am mocking it like below\r\n\r\n@PrepareForTest({YUtil.class})\r\nmockStatic(YUtil.class);\r\nexpect(YUtil.getPort(123L)).andReturn(20L);\r\n\r\nWhat i have noticed is its going inside the YUtil and also inside Xutil.\r\nThis means my expect is not working.\r\n\r\nI have done replayAll.\r\n\r\nThe java assist that i am using is javassist-3.9.0.GA\r\n\r\nOne more observation : Xutil.class is too large(About 6000 lines).\n\n**Attachment:** [ErrorLog.txt](http://code.google.com/p/powermock/issues/detail?id=262)\n\n_Original issue: http://code.google.com/p/powermock/issues/detail?id=262_"},"comment":{"url":"https://api.github.com/repos/jayway/powermock/issues/comments/124345458","html_url":"https://github.com/jayway/powermock/issues/282#issuecomment-124345458","issue_url":"https://api.github.com/repos/jayway/powermock/issues/282","id":124345458,"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-24T06:30:27Z","updated_at":"2015-07-24T06:30:27Z","body":"_From [vichhu...@yahoo.com](https://code.google.com/u/104162302400230282206/) on June 10, 2010 01:01:42_\n\nI just reduced the size of Xutil.class by retaining only getPortsForCircuit method which i require and tried running, its working now.\r\n\r\nIt fails with the attached error only when you do \"Coverage As\" JUnit Test, instead if you do \"Run As\" Junit Test it works fine even with the large file size.\r\n\r\nplease comment on this."}}