@Override public void deletePipelineExecution(final String executionId) throws BusinessException { pipelineService.deletePipelineExecution(executionId); } }
@Override public List<PipelineConfig> getPipelineConfigs(Integer page, Integer pageSize, String sort, boolean sortOrder) throws BusinessException { return pipelineService.getPipelineConfigs(page, pageSize, sort, sortOrder).getItems(); }
@Override public String newPipeline(PipelineConfig pipelineConfig, ProviderType providerType) throws BusinessException { return pipelineService.newPipeline(pipelineConfig, providerType); }
PipelineConfigsList allPipelineConfigs = pipelineService.getPipelineConfigs(0, 10, "", pipelineService.newPipeline(new PipelineConfigImpl("mypipe", configs)); pipelineService.newPipeline(new PipelineConfigImpl("wildlfyPipe", configs), WildflyProviderType.instance()); pipelineService.newPipeline(new PipelineConfigImpl("dockerPipe", configs), DockerProviderType.instance()); allPipelineConfigs = pipelineService.getPipelineConfigs(0, 10, "", PipelineConfigsList wildflyConfigs = pipelineService.getPipelineConfigs(WildflyProviderType.instance().getProviderTypeName(), WildflyProviderType.instance().getVersion(), 0, List<String> wildflyPipelineNames = pipelineService.getPipelineNames(WildflyProviderType.instance().getProviderTypeName(), WildflyProviderType.instance().getVersion(), 0, PipelineConfigsList dockerConfigs = pipelineService.getPipelineConfigs(DockerProviderType.instance().getProviderTypeName(), DockerProviderType.instance().getVersion(),
new MavenProjectConfigImpl())); pipelineService.newPipeline(new PipelineConfigImpl("mypipe", configs)); gitUrl); pipelineService.runPipeline("mypipe", input, false);
@Override public String runPipeline(String id, Input input, boolean async) throws BusinessException { return pipelineService.runPipeline(id, input, async); }
@Override public void stopPipelineExecution(final String executionId) throws BusinessException { pipelineService.stopPipelineExecution(executionId); }
@Override public List<String> getPipelineNames(ProviderType providerType, Integer page, Integer pageSize, String sort, boolean sortOrder) throws BusinessException { return pipelineService.getPipelineNames(providerType.getProviderTypeName(), providerType.getVersion(), page, pageSize, sort, sortOrder); }
private void testRunPipeline(boolean async) { Input input = mock(Input.class); when(pipelineService.runPipeline(PIPELINE_NAME, input, async)).thenReturn(PIPELINE_EXECUTION_ID); String result = pipelineServiceBackend.runPipeline(PIPELINE_NAME, input, async); verify(pipelineService, times(1)).runPipeline(PIPELINE_NAME, input, async); assertEquals(PIPELINE_EXECUTION_ID, result); }
@Test public void testStopPipelineExecution() { pipelineServiceBackend.stopPipelineExecution(PIPELINE_EXECUTION_ID); verify(pipelineService, times(1)).stopPipelineExecution(PIPELINE_EXECUTION_ID); }
@Test public void testGetPipelineNames() { List<String> values = mock(List.class); when(pipelineService.getPipelineNames(PROVIDER_TYPE_NAME, PROVIDER_TYPE_VERSION, PAGE, PAGE_SIZE, SORT, SORT_ORDER)).thenReturn(values); List<String> result = pipelineServiceBackend.getPipelineNames(providerType, PAGE, PAGE_SIZE, SORT, SORT_ORDER); verify(pipelineService, times(1)).getPipelineNames(PROVIDER_TYPE_NAME, PROVIDER_TYPE_VERSION, PAGE, PAGE_SIZE, SORT, SORT_ORDER); assertEquals(values, result); }
@Override public List<PipelineConfig> getPipelineConfigs(ProviderType providerType, Integer page, Integer pageSize, String sort, boolean sortOrder) throws BusinessException { return pipelineService.getPipelineConfigs(providerType.getProviderTypeName(), providerType.getVersion(), page, pageSize, sort, sortOrder).getItems(); }
@Override public String newPipeline(PipelineConfig config) throws BusinessException { return pipelineService.newPipeline(config); }
@Test public void testDeletePipelineExecution() { pipelineServiceBackend.deletePipelineExecution(PIPELINE_EXECUTION_ID); verify(pipelineService, times(1)).deletePipelineExecution(PIPELINE_EXECUTION_ID); } }
@Test public void testGetPipelineConfigs() { List<PipelineConfig> values = mockList(PipelineConfig.class, ELEMENTS_COUNT); PipelineConfigsList list = new PipelineConfigsList(values); when(pipelineService.getPipelineConfigs(PAGE, PAGE_SIZE, SORT, SORT_ORDER)).thenReturn(list); List<PipelineConfig> result = pipelineServiceBackend.getPipelineConfigs(PAGE, PAGE_SIZE, SORT, SORT_ORDER); verify(pipelineService, times(1)).getPipelineConfigs(PAGE, PAGE_SIZE, SORT, SORT_ORDER); assertEquals(result, values); }
@Test public void testNewPipelineForProvider() { PipelineConfig pipelineConfig = mock(PipelineConfig.class); when(pipelineService.newPipeline(pipelineConfig, providerType)).thenReturn(PIPELINE_NAME); String result = pipelineServiceBackend.newPipeline(pipelineConfig, providerType); verify(pipelineService, times(1)).newPipeline(pipelineConfig, providerType); assertEquals(PIPELINE_NAME, result); }
@Test public void testGetPipelineConfigsForProviderType() { List<PipelineConfig> values = mockList(PipelineConfig.class, ELEMENTS_COUNT); PipelineConfigsList list = new PipelineConfigsList(values); when(pipelineService.getPipelineConfigs(PROVIDER_TYPE_NAME, PROVIDER_TYPE_VERSION, PAGE, PAGE_SIZE, SORT, SORT_ORDER)).thenReturn(list); List<PipelineConfig> result = pipelineServiceBackend.getPipelineConfigs(providerType, PAGE, PAGE_SIZE, SORT, SORT_ORDER); verify(pipelineService, times(1)).getPipelineConfigs(PROVIDER_TYPE_NAME, PROVIDER_TYPE_VERSION, PAGE, PAGE_SIZE, SORT, SORT_ORDER); assertEquals(result, values); }
@Test public void testNewPipeline() { PipelineConfig pipelineConfig = mock(PipelineConfig.class); when(pipelineService.newPipeline(pipelineConfig)).thenReturn(PIPELINE_NAME); String result = pipelineServiceBackend.newPipeline(pipelineConfig); verify(pipelineService, times(1)).newPipeline(pipelineConfig); assertEquals(PIPELINE_NAME, result); }