@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); }
@Test public void testGetRuntimeItems() { ProviderTypeKey providerTypeKey = new ProviderTypeKey(PROVIDER_NAME, PROVIDER_VERSION); ProviderKey providerKey = new ProviderKey(providerTypeKey, PROVIDER_ID); when(runtimeProvisioningService.executeQuery(any(RuntimeQuery.class))).thenReturn(queryItems); Collection<RuntimeListItem> result = service.getRuntimeItems(providerKey); Collection<RuntimeListItem> expectedResult = buildExpectedResult(queryItems); assertEquals(expectedResult, result); }
@Test public void testGetRuntimeItems() { ProviderTypeKey providerTypeKey = new ProviderTypeKey(PROVIDER_NAME, PROVIDER_VERSION); ProviderKey providerKey = new ProviderKey(providerTypeKey, PROVIDER_ID); when(runtimeProvisioningService.executeQuery(any(RuntimeQuery.class))).thenReturn(queryItems); Collection<RuntimeListItem> result = service.getRuntimeItems(providerKey); Collection<RuntimeListItem> expectedResult = buildExpectedResult(queryItems); assertEquals(expectedResult, result); }