WakeOnLanServiceEndPoint { @GET @Path("wakeonlan/{mac}") public String startHost(@PathParam("mac") String mac) { logger.info("Waking up host: " + mac); return startHostService.startHost(mac); }  @GET @Path("wakeonlan/{mac}") String startHost(@PathParam("mac") String mac);  }
@Test public void consultarTest() { String macTest = "mac teste"; String returnExpected = "ok"; Mockito.doReturn(returnExpected).when(startHostService).startHost(Mockito.anyString()); String returnOfCommand = wakeOnLanServiceEndPoint.startHost(macTest); Assert.assertEquals(returnExpected, returnOfCommand); Mockito.verify(startHostService).startHost(macTest); }