The InetAddress constructor is not visible because the factory pattern is used.
final InetAddress anyInstance = InetAddress.getLocalHost();
new NonStrictExpectations(InetAddress.class) {
{
anyInstance.getHostAddress();
result = "192.168.0.101";
}
};
When I try to use the factory method to get an instance for partial mocking I get the error:
java.lang.IllegalStateException: Missing invocation to mocked type at this point; please make sure such invocations appear only after the declaration of a suitable mock field or parameter