Ejemplo n.º 1
0
 @Test
 public void testStopShouldCallStopJettyServer() throws Exception {
   // GIVEN
   doNothing().when(underTest).stopServer();
   // WHEN
   underTest.stop();
   // THEN
   verify(underTest).stopServer();
 }
Ejemplo n.º 2
0
 @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);
 }