@Test(expected = IllegalStateException.class) public void testCallProcessIsRunning() { UUID procId = UUID.randomUUID(); Future<?> fut = mock(Future.class); doReturn(false).when(fut).isDone(); metadataStorage.put(procId, fut); LongRunningProcessClearTask clearTask = createTask(procId); clearTask.call(); }
@Override public List<LongRunningProcessStatus> call() { ArrayList<LongRunningProcessStatus> res = new ArrayList<>(); for (UUID prodId : procIds) res.add(prepareProcessForRemoving(prodId)); removeProcessesFromMetadataStorage(); return res; }
LongRunningProcessClearTask extends LongRunningProcessTask<List<LongRunningProcessStatus>> { @Override public List<LongRunningProcessStatus> call() { ArrayList<LongRunningProcessStatus> res = new ArrayList<>(); for (UUID prodId : procIds) res.add(prepareProcessForRemoving(prodId)); removeProcessesFromMetadataStorage(); return res; } }
LongRunningProcessClearTask extends LongRunningProcessTask<List<LongRunningProcessStatus>> { @Override public List<LongRunningProcessStatus> call() { ArrayList<LongRunningProcessStatus> res = new ArrayList<>(); for (UUID prodId : procIds) res.add(prepareProcessForRemoving(prodId)); removeProcessesFromMetadataStorage(); return res; } LongRunningProcessClearTask(List<UUID> procIds); }
LongRunningProcessClearTask extends LongRunningProcessTask<List<LongRunningProcessStatus>> { @Override public List<LongRunningProcessStatus> call() { ArrayList<LongRunningProcessStatus> res = new ArrayList<>(); for (UUID prodId : procIds) res.add(prepareProcessForRemoving(prodId)); removeProcessesFromMetadataStorage(); return res; } LongRunningProcessClearTask(List<UUID> procIds); @Override List<LongRunningProcessStatus> call(); }
LongRunningProcessClearTask extends LongRunningProcessTask<List<LongRunningProcessStatus>> { @Override public List<LongRunningProcessStatus> call() { ArrayList<LongRunningProcessStatus> res = new ArrayList<>(); for (UUID prodId : procIds) res.add(prepareProcessForRemoving(prodId)); removeProcessesFromMetadataStorage(); return res; } LongRunningProcessClearTask(List<UUID> procIds); @Override List<LongRunningProcessStatus> call();  }