For example, i have such class:
class Foo {
public String xMethod() {
Ent ent = y.callExternalMethod();
if(ent.equals("")){
...
}
...
}
And a test class:
class FooTest {
@Mock
Ent ent = new Ent(someData);
@InjectMocks
Foo f;
public void checkFooWithMock() {
...
}
}
I need to use mocked ent instance in this case, how can i do that?