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. Unzip the eclipse project attached to the issue
2 . Run the unit test. What is the expected output? What do you see instead? Expected the test to pass but it fails with org.powermock.reflect.exceptions.MethodNotFoundException: No methods matching the name(s) stream were found in the class hierarchy of class java.util.ArrayList. What version of the product are you using? On what operating system? Powermock 1.5.5 on Windows 8.1 with Java 8
P.S.: Something weird about it is that when I Mock List in debugger mode I can see the size but when I want to run that line I get the expiation.
if (rawRecords.size() > topicConfig.getInt("maximum.batch.size")) {
....
}
In debugger I can see the rawRecords.size() is 2 and topicConfig.getInt("maximum.batch.size") is one and also the expression rawRecords.size() > topicConfig.getInt("maximum.batch.size") is true but when I want to step over this line I get the exception.
@RunWith(PowerMockRunner.class)
@PrepareForTest({KafkaService.class, ConfigFactory.class, Config.class})
public class KafkaServiceTest {
@Test
public void recordSizeGreaterThanAllowedBatchSize() throws Exception {
PowerMockito.doReturn(2).when(records, "size");
when(topicConfig.getInt("maximum.batch.size")).thenReturn(1);
......
}
}
From BinisBe...@gmail.com on September 03, 2014 10:31:56
What steps will reproduce the problem? 1. Unzip the eclipse project attached to the issue
2 . Run the unit test. What is the expected output? What do you see instead? Expected the test to pass but it fails with org.powermock.reflect.exceptions.MethodNotFoundException: No methods matching the name(s) stream were found in the class hierarchy of class java.util.ArrayList. What version of the product are you using? On what operating system? Powermock 1.5.5 on Windows 8.1 with Java 8
Attachment: mockTest.zip
Original issue: http://code.google.com/p/powermock/issues/detail?id=516
The text was updated successfully, but these errors were encountered: