{"action":"opened","issue":{"url":"https://api.github.com/repos/jayway/powermock/issues/506","labels_url":"https://api.github.com/repos/jayway/powermock/issues/506/labels{/name}","comments_url":"https://api.github.com/repos/jayway/powermock/issues/506/comments","events_url":"https://api.github.com/repos/jayway/powermock/issues/506/events","html_url":"https://github.com/jayway/powermock/issues/506","id":97196689,"number":506,"title":"Powermock ignores the answer in the @Mock annotation ","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":0,"created_at":"2015-07-25T05:51:14Z","updated_at":"2015-07-25T05:51:14Z","closed_at":null,"body":"_From [ger...@gmail.com](https://code.google.com/u/112342141579751635264/) on March 06, 2014 09:21:47_\n\nWhat steps will reproduce the problem? Write a test, where a field is annotated with @Mock(answer = Answers.CALLS_REAL_METHODS) What is the expected output? What do you see instead? In Mockito, this works perfectly. It simply calls the real methods of the mock. \r\nIn PowerMock, this does nothing. It's simply a mock. You have to mock the methods to get any result. What version of the product are you using? On what operating system? PowerMockito 1.5.4\r\nMockito 1.9.5\r\n\r\nMac OS X 10.9.2 Please provide any additional information below. Workaround for this problem: let's say that I have this mock present in my test: \r\n\r\n@Mock(answer = Answers.CALLS_REAL_METHODS) private TimestampToStringConverter timestampToStringConverter;\r\n\r\nIn order to have it actually call the real methods of the mock, I have to do this in my setup method: \r\n\r\nwhen(timestampToStringConverter.convert(any(Timestamp.class))).thenCallRealMethod();\r\n\r\nIt is infuriating, however, because you have to actually do this for EVERY method you want to use in your test. If you have a class which has 8 methods, which you all use, you're doing this for every single one of them. It leads to an ugly blob of code.\n\n_Original issue: http://code.google.com/p/powermock/issues/detail?id=486_"}}