I am mocking InetAddress, When I am mocking this I am getting mocked object instead of my expected string
InetAddress inetAddress = Mockito.mock(InetAddress.class);
Mockito.when(inetAddress.getHostName()).thenReturn("test")
System.out.printinetAddress.getHostName());
I think It should print test in a console but it is printing mocked object hashcode.