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
I find that I get NullPointerExceptions when invoking toString() on
any mock objects generated by PowerMock. The following simple code
will re-create the problem:
From johan.ha...@gmail.com on March 15, 2010 13:24:33
I find that I get NullPointerExceptions when invoking toString() on
any mock objects generated by PowerMock. The following simple code
will re-create the problem:
import javax.crypto.Cipher;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
@RunWith(PowerMockRunner.class)
@PrepareForTest(Cipher.class)
public class MyTest {
private Cipher cipher;
@test
public void test1() throws Exception {
cipher = PowerMockito.mock(Cipher.class);
}
}
We use Log4j quite heavily to log method parameters and using injected
PowerMock objects makes this a big issue for us.
Original issue: http://code.google.com/p/powermock/issues/detail?id=239
The text was updated successfully, but these errors were encountered: