@Test public void testJenkinsConnectivityBroken() throws IOException { Mockito.when(client.get("/")).thenThrow(IOException.class); assertEquals(server.isRunning(), false); }
@Test public void testJenkinsConnectivity() throws IOException { Mockito.when(client.get("/")).thenReturn("<xml>not a real response</xml>"); assertEquals(server.isRunning(), true); }