### Question:
PipelineServiceBackendImpl implements PipelineServiceBackend { @Override public String newPipeline(PipelineConfig pipelineConfig, ProviderType providerType) throws BusinessException { return pipelineService.newPipeline(pipelineConfig, providerType); } PipelineServiceBackendImpl(); @Inject  PipelineServiceBackendImpl(final PipelineService pipelineService); @Override List<PipelineConfig> getPipelineConfigs(Integer page,
                                                   Integer pageSize,
                                                   String sort,
                                                   boolean sortOrder); @Override List<PipelineConfig> getPipelineConfigs(ProviderType providerType,
                                                   Integer page,
                                                   Integer pageSize,
                                                   String sort,
                                                   boolean sortOrder); @Override List<String> getPipelineNames(ProviderType providerType,
                                         Integer page,
                                         Integer pageSize,
                                         String sort,
                                         boolean sortOrder); @Override String newPipeline(PipelineConfig pipelineConfig,
                              ProviderType providerType); @Override String newPipeline(PipelineConfig config); @Override String runPipeline(String id,
                              Input input,
                              boolean async); @Override void stopPipelineExecution(final String executionId); @Override void deletePipelineExecution(final String executionId);  }### Answer:
@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 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); }