Rajesh
unread,Aug 28, 2009, 5:50:02 PM8/28/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to mockito
Hi,
I was trying to mock KeyStore class, hit into the this issue.
"java.security.KeyStoreException: Uninitialized keystore". Here is a
sample code to reproduce this issue. I am expecting it to print null,
but throws Uninitialized KeyStore as if you have called a method on
real keystore object.
import static org.mockito.Mockito.mock;
import java.security.KeyStore;
public class MockTest {
public static void main(String[] args) throws Exception {
KeyStore keyStore = mock(KeyStore.class);
System.out.println(keyStore.getKey("","".toCharArray()));
}
}
Please help, or a workaround.
Thanks
Rajesh