@Test public void whenGetTransferThenOK() throws ProcessingException { HandlerIO handlerIO = mock(HandlerIOImpl.class); doAnswer(o -> o) .when(handlerIO).transferInputStreamToWorkspace(any(), any(), any(), anyBoolean()); WorkspaceQueue workspaceQueue = mock(WorkspaceQueue.class); when(workspaceQueue.getAction()).thenReturn(WorkspaceAction.TRANSFER); WorkspaceTransferTask workspaceTransferTask = new WorkspaceTransferTask(handlerIO, workspaceQueue); workspaceTransferTask.get(); }
@Override public Boolean get() { try { switch (task.getAction()) { case TRANSFER: handlerIO .transferInputStreamToWorkspace(task.getWorkspacePath(), task.getSourceFile(), task.getFilePath(), false); break; case UNZIP: handlerIO.unzipInputStreamOnWorkspace(handlerIO.getContainerName(), task.getFolderName(), task.getMediaType(), task.getSourceFile(), false); break; default: return Boolean.FALSE; } return Boolean.TRUE; } catch (Exception e) { throw new RuntimeException(e); } }
WorkspaceTransferTask implements Supplier<Boolean> { @Override public Boolean get() { try { switch (task.getAction()) { case TRANSFER: handlerIO .transferInputStreamToWorkspace(task.getWorkspacePath(), task.getSourceFile(), task.getFilePath(), false); break; case UNZIP: handlerIO.unzipInputStreamOnWorkspace(handlerIO.getContainerName(), task.getFolderName(), task.getMediaType(), task.getSourceFile(), false); break; default: return Boolean.FALSE; } return Boolean.TRUE; } catch (Exception e) { throw new RuntimeException(e); } } }
WorkspaceTransferTask implements Supplier<Boolean> { @Override public Boolean get() { try { switch (task.getAction()) { case TRANSFER: handlerIO .transferInputStreamToWorkspace(task.getWorkspacePath(), task.getSourceFile(), task.getFilePath(), false); break; case UNZIP: handlerIO.unzipInputStreamOnWorkspace(handlerIO.getContainerName(), task.getFolderName(), task.getMediaType(), task.getSourceFile(), false); break; default: return Boolean.FALSE; } return Boolean.TRUE; } catch (Exception e) { throw new RuntimeException(e); } } WorkspaceTransferTask(HandlerIO handlerAsyncIO, WorkspaceQueue task); }
WorkspaceTransferTask implements Supplier<Boolean> { @Override public Boolean get() { try { switch (task.getAction()) { case TRANSFER: handlerIO .transferInputStreamToWorkspace(task.getWorkspacePath(), task.getSourceFile(), task.getFilePath(), false); break; case UNZIP: handlerIO.unzipInputStreamOnWorkspace(handlerIO.getContainerName(), task.getFolderName(), task.getMediaType(), task.getSourceFile(), false); break; default: return Boolean.FALSE; } return Boolean.TRUE; } catch (Exception e) { throw new RuntimeException(e); } } WorkspaceTransferTask(HandlerIO handlerAsyncIO, WorkspaceQueue task); @Override Boolean get(); }
WorkspaceTransferTask implements Supplier<Boolean> { @Override public Boolean get() { try { switch (task.getAction()) { case TRANSFER: handlerIO .transferInputStreamToWorkspace(task.getWorkspacePath(), task.getSourceFile(), task.getFilePath(), false); break; case UNZIP: handlerIO.unzipInputStreamOnWorkspace(handlerIO.getContainerName(), task.getFolderName(), task.getMediaType(), task.getSourceFile(), false); break; default: return Boolean.FALSE; } return Boolean.TRUE; } catch (Exception e) { throw new RuntimeException(e); } } WorkspaceTransferTask(HandlerIO handlerAsyncIO, WorkspaceQueue task); @Override Boolean get();  }