HttpUtils { public String wakeHaltedHostUsingHttpGet(String systemVmIp, String hostMac) { try { URL url = new URL(String.format("http: return executeHttpGetRequest(url); } catch (IOException e) { logger.debug(String.format("Error while calling Wakeonlan service for host mac address[%s]", hostMac), e); return e.getMessage(); } }  String wakeHaltedHostUsingHttpGet(String systemVmIp, String hostMac); String executeHttpGetRequest(URL url);  }
@Test public void wakeHaltedHostUsingHttpGetTest() throws Exception { Mockito.doReturn("result").when(spy).executeHttpGetRequest(Mockito.any(URL.class)); String result = spy.wakeHaltedHostUsingHttpGet("systemVmIp", "hostMac"); verifyWakeHaltedHostUsingHttpGetTest("result", result); }