public void testNotifyStartedWhenNotStarting() { AbstractService service = new DefaultService(); try { service.notifyStarted(); fail(); } catch (IllegalStateException expected) { } }
@Override protected void doStart() { super.notifyStarted(); System.out.println("Error service is running now"); if (throwError) { throwError = false; throw new RuntimeException("Error"); } }
public void testNotifyStartedWhenNotStarting() { AbstractService service = new DefaultService(); try { service.notifyStarted(); fail(); } catch (IllegalStateException expected) {} }