Apologies if it's already been discussed but I didn't find any solutions.
Problem - Trying to mock an object of my Class of some type (e.g. class)
Writing test case of method xyz() where i need to mock SomeClass.class as mentioned in below code snippets
void xyz() {
..
MyOtherClass.staticMethod(SomeClass.class);
..
}
MyOtherClass {
..
<T> T staticMethod(Class<T> clazz) {
}
...
}
- Using power mockito
- Tried (Class) Mockito.mock(Class.class), which is not working.
I hope above code clears the problem. Any help much appreciated.
Thanks a ton!