@Test public void testStopShouldCallStopJettyServer() throws Exception { // GIVEN doNothing().when(underTest).stopServer(); // WHEN underTest.stop(); // THEN verify(underTest).stopServer(); }
@Test public void testStopShouldLogErrorWhenWebAppCanNotBeStopped() throws Exception { // GIVEN willThrow(new Exception(EXCPEPTION_MESSAGE)).given(underTest).stopServer(); // WHEN underTest.stop(); // THEN verify(logger).error("Proxy can not be stopped: " + EXCPEPTION_MESSAGE); }