You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What steps will reproduce the problem? 1. Have a class with a final field, and a constructor initializing it
2. Create a test using PowerMockRunner, and mock the field, then using @Injectmocks over instance of the class to test
3. During runtime, you'll see that the instance of the mock created in your test is not the one getting injected What is the expected output? What do you see instead? The mock-instance I create in my test should be injected What version of the product are you using? On what operating system? 1.5.
Ubuntu 14.04. Please provide any additional information below. If not using PowerMockRunner (i.e. MockitoJUnitRunner or just regular JUnit), it works as it should
Awesome that PowerMock will support this! Any idea when the release will happen?
Just out of curiosity, what do you mean by "InjectMocks was not supported"? If we made the field non-final, it worked fine in our case. Or did you mean Injecting mocks into final fields?
From sbekkhu...@gmail.com on July 18, 2014 13:28:54
What steps will reproduce the problem? 1. Have a class with a final field, and a constructor initializing it
2. Create a test using PowerMockRunner, and mock the field, then using @Injectmocks over instance of the class to test
3. During runtime, you'll see that the instance of the mock created in your test is not the one getting injected What is the expected output? What do you see instead? The mock-instance I create in my test should be injected What version of the product are you using? On what operating system? 1.5.
Ubuntu 14.04. Please provide any additional information below. If not using PowerMockRunner (i.e. MockitoJUnitRunner or just regular JUnit), it works as it should
Original issue: http://code.google.com/p/powermock/issues/detail?id=506
The text was updated successfully, but these errors were encountered: