@Test public void getRuntimeItemByRuntimeKeyExisting() { ProviderKey providerKey = mock(ProviderKey.class); RuntimeKey runtimeKey = new RuntimeKey(providerKey, RUNTIME_ID); List<RuntimeQueryResultItem> singleResult = mockRuntimeQueryResultItemList(1); when(runtimeProvisioningService.executeQuery(any(RuntimeQuery.class))).thenReturn(singleResult); RuntimeListItem expectedItem = buildExpectedResult(singleResult).iterator().next(); RuntimeListItem result = service.getRuntimeItem(runtimeKey); assertEquals(expectedItem, result); }
@Test public void getRuntimeItemByRuntimeKeyExisting() { ProviderKey providerKey = mock(ProviderKey.class); RuntimeKey runtimeKey = new RuntimeKey(providerKey, RUNTIME_ID); List<RuntimeQueryResultItem> singleResult = mockRuntimeQueryResultItemList(1); when(runtimeProvisioningService.executeQuery(any(RuntimeQuery.class))).thenReturn(singleResult); RuntimeListItem expectedItem = buildExpectedResult(singleResult).iterator().next(); RuntimeListItem result = service.getRuntimeItem(runtimeKey); assertEquals(expectedItem, result); }
@Test public void getRuntimeItemByPipelineExecutionKeyExisting() { PipelineExecutionTraceKey traceKey = new PipelineExecutionTraceKey(PIPELINE_EXECUTION_ID); List<RuntimeQueryResultItem> singleResult = mockRuntimeQueryResultItemList(1); when(runtimeProvisioningService.executeQuery(any(RuntimeQuery.class))).thenReturn(singleResult); RuntimeListItem expectedItem = buildExpectedResult(singleResult).iterator().next(); RuntimeListItem result = service.getRuntimeItem(traceKey); assertEquals(expectedItem, result); }
@Test public void getRuntimeItemByPipelineExecutionKeyExisting() { PipelineExecutionTraceKey traceKey = new PipelineExecutionTraceKey(PIPELINE_EXECUTION_ID); List<RuntimeQueryResultItem> singleResult = mockRuntimeQueryResultItemList(1); when(runtimeProvisioningService.executeQuery(any(RuntimeQuery.class))).thenReturn(singleResult); RuntimeListItem expectedItem = buildExpectedResult(singleResult).iterator().next(); RuntimeListItem result = service.getRuntimeItem(traceKey); assertEquals(expectedItem, result); }
@Before public void setUp() { when(project.getProjectName()).thenReturn(PROJECT_NAME); queryItems = mockRuntimeQueryResultItemList(QUERY_ITEMS_SIZE); pipelineNames = mockPipelineNames(QUERY_ITEMS_SIZE); pipelineKeys = mockPipelineKeys(pipelineNames); service = new RuntimeServiceImpl(runtimeProvisioningService, pipelineService, providerService, runtimeChangeEvent, pipelineExecutionChangeEvent); }
@Before public void setUp() { when(module.getModuleName()).thenReturn(MODULE_NAME); queryItems = mockRuntimeQueryResultItemList(QUERY_ITEMS_SIZE); pipelineNames = mockPipelineNames(QUERY_ITEMS_SIZE); pipelineKeys = mockPipelineKeys(pipelineNames); service = new RuntimeServiceImpl(runtimeProvisioningService, pipelineService, providerService, runtimeChangeEvent, pipelineExecutionChangeEvent); }