@Test public void whenLifeCycleStartedThenProcessLifeCycleStartProcess() throws InterruptedException { ProcessLifeCycle plc = mock(ProcessLifeCycle.class); final Semaphore semaphore = new Semaphore(0); doAnswer(o -> { semaphore.release(); return o; }).when(plc).startProcess(); new VitamServerLifeCycle(plc).lifeCycleStarted(mock(LifeCycle.class)); semaphore.tryAcquire(1, TimeUnit.SECONDS); verify(plc).startProcess(); }
@Override public void lifeCycleStarted(LifeCycle event) { VitamThreadPoolExecutor.getDefaultExecutor().execute(() -> processLifeCycle.startProcess()); }
VitamServerLifeCycle implements Listener { @Override public void lifeCycleStarted(LifeCycle event) { VitamThreadPoolExecutor.getDefaultExecutor().execute(() -> processLifeCycle.startProcess()); } }
VitamServerLifeCycle implements Listener { @Override public void lifeCycleStarted(LifeCycle event) { VitamThreadPoolExecutor.getDefaultExecutor().execute(() -> processLifeCycle.startProcess()); } VitamServerLifeCycle(ProcessLifeCycle processLifeCycle); }
VitamServerLifeCycle implements Listener { @Override public void lifeCycleStarted(LifeCycle event) { VitamThreadPoolExecutor.getDefaultExecutor().execute(() -> processLifeCycle.startProcess()); } VitamServerLifeCycle(ProcessLifeCycle processLifeCycle); @Override void lifeCycleStarting(LifeCycle event); @Override void lifeCycleStarted(LifeCycle event); @Override void lifeCycleFailure(LifeCycle event, Throwable cause); @Override void lifeCycleStopping(LifeCycle event); @Override void lifeCycleStopped(LifeCycle event); }
VitamServerLifeCycle implements Listener { @Override public void lifeCycleStarted(LifeCycle event) { VitamThreadPoolExecutor.getDefaultExecutor().execute(() -> processLifeCycle.startProcess()); } VitamServerLifeCycle(ProcessLifeCycle processLifeCycle); @Override void lifeCycleStarting(LifeCycle event); @Override void lifeCycleStarted(LifeCycle event); @Override void lifeCycleFailure(LifeCycle event, Throwable cause); @Override void lifeCycleStopping(LifeCycle event); @Override void lifeCycleStopped(LifeCycle event);  }