- there some limitations from PowerMock to mock java system related class in groovy (mentioned here)
- showcase a workaround using
PowerMock.replace()
(PowerMock.stub()
will work too but there's no way for verification) - example in DnsLookupServiceTest's testcase 1
- example in DnsLookupServiceTest's testcase 2