@Test(expected = ProcessingStorageWorkspaceException.class) public void isProcessContainerExistTestException() throws Exception { doThrow(new ContentAddressableStorageServerException("fail")).when(workspaceClient).isExistingContainer (anyString()); processDataManagement.isProcessContainerExist(); }
@Override public boolean isProcessContainerExist() throws ProcessingStorageWorkspaceException { try (WorkspaceClient client = workspaceClientFactory.getClient()) { return client.isExistingContainer(PROCESS_CONTAINER); } catch (ContentAddressableStorageServerException exc) { throw new ProcessingStorageWorkspaceException(exc); } }
WorkspaceProcessDataManagement implements ProcessDataManagement { @Override public boolean isProcessContainerExist() throws ProcessingStorageWorkspaceException { try (WorkspaceClient client = workspaceClientFactory.getClient()) { return client.isExistingContainer(PROCESS_CONTAINER); } catch (ContentAddressableStorageServerException exc) { throw new ProcessingStorageWorkspaceException(exc); } } }
WorkspaceProcessDataManagement implements ProcessDataManagement { @Override public boolean isProcessContainerExist() throws ProcessingStorageWorkspaceException { try (WorkspaceClient client = workspaceClientFactory.getClient()) { return client.isExistingContainer(PROCESS_CONTAINER); } catch (ContentAddressableStorageServerException exc) { throw new ProcessingStorageWorkspaceException(exc); } } private  WorkspaceProcessDataManagement(); @VisibleForTesting  WorkspaceProcessDataManagement(WorkspaceClientFactory workspaceClientFactory); }
WorkspaceProcessDataManagement implements ProcessDataManagement { @Override public boolean isProcessContainerExist() throws ProcessingStorageWorkspaceException { try (WorkspaceClient client = workspaceClientFactory.getClient()) { return client.isExistingContainer(PROCESS_CONTAINER); } catch (ContentAddressableStorageServerException exc) { throw new ProcessingStorageWorkspaceException(exc); } } private  WorkspaceProcessDataManagement(); @VisibleForTesting  WorkspaceProcessDataManagement(WorkspaceClientFactory workspaceClientFactory); static ProcessDataManagement getInstance(); @Override boolean createProcessContainer(); @Override boolean isProcessContainerExist(); @Override boolean createFolder(String folderName); @Override boolean isFolderExist(String folderName); @Override boolean removeFolder(String folderName); @Override void persistProcessWorkflow(String folderName, ProcessWorkflow processWorkflow); @Override void persistDistributorIndex(String folderName, String fileName, DistributorIndex distributorIndex); @Override Optional<DistributorIndex> getDistributorIndex(String folderName, String fileName); @Override ProcessWorkflow getProcessWorkflow(String folderName, String asyncId); @Override void removeProcessWorkflow(String folderName, String asyncId); @Override Map<String, ProcessWorkflow> getProcessWorkflowFor(Integer tenantId, String folderName); }
WorkspaceProcessDataManagement implements ProcessDataManagement { @Override public boolean isProcessContainerExist() throws ProcessingStorageWorkspaceException { try (WorkspaceClient client = workspaceClientFactory.getClient()) { return client.isExistingContainer(PROCESS_CONTAINER); } catch (ContentAddressableStorageServerException exc) { throw new ProcessingStorageWorkspaceException(exc); } } private  WorkspaceProcessDataManagement(); @VisibleForTesting  WorkspaceProcessDataManagement(WorkspaceClientFactory workspaceClientFactory); static ProcessDataManagement getInstance(); @Override boolean createProcessContainer(); @Override boolean isProcessContainerExist(); @Override boolean createFolder(String folderName); @Override boolean isFolderExist(String folderName); @Override boolean removeFolder(String folderName); @Override void persistProcessWorkflow(String folderName, ProcessWorkflow processWorkflow); @Override void persistDistributorIndex(String folderName, String fileName, DistributorIndex distributorIndex); @Override Optional<DistributorIndex> getDistributorIndex(String folderName, String fileName); @Override ProcessWorkflow getProcessWorkflow(String folderName, String asyncId); @Override void removeProcessWorkflow(String folderName, String asyncId); @Override Map<String, ProcessWorkflow> getProcessWorkflowFor(Integer tenantId, String folderName);  }