I am trying to test a class (using Jukito and Mockito), which unfortunately extends another class, which has a static method call. Is it possible to somehow skip this call? I would rather not use PowerMockito.
public class A extends B {
@Inject
public A(final String s){
super(s);
}
}
public abstract class B {
private String s;
protected String m = C.get().createUniqueId(); //Exception is thrown here
public B(String s){
this.s = s;
}
}
public class C {
private static C c; //assume this is never null
public static C get() {
return c;
}
public final native String createUniqueId() {}
}
@RunWith(JukitoRunner.class)
public class ATest {
@Inject
A a;
@Test
public void onMethod1Test(){
}
}
When running ATest, I get the following error:
Error injecting constructor, java.lang.UnsatisfiedLinkError: C
I assumed it's because of a static method, was I wrong?
Note that all the classes are just examples from my real classes and C class was not written by my and can not be changed (unfortunately). But idea behind my classes and these are the same, I just changed names and left only relevant parts.