use of org.guvnor.ala.ui.model.RuntimeListItem in project kie-wb-common by kiegroup.
the class RuntimeListItemBuilderTest method testBuildItemLabelForRuntime.
@Test
public void testBuildItemLabelForRuntime() {
queryResultItem.setRuntimeName(RUNTIME_NAME);
RuntimeListItem result = RuntimeListItemBuilder.newInstance().withItem(queryResultItem).build();
assertEquals(RUNTIME_NAME, result.getItemLabel());
}
use of org.guvnor.ala.ui.model.RuntimeListItem in project kie-wb-common by kiegroup.
the class RuntimeListItemBuilderTest method testBuildItemLabelForRuntimeName.
@Test
public void testBuildItemLabelForRuntimeName() {
queryResultItem.setRuntimeName(RUNTIME_ID);
RuntimeListItem result = RuntimeListItemBuilder.newInstance().withItem(queryResultItem).build();
assertEquals(RUNTIME_ID, result.getItemLabel());
}
use of org.guvnor.ala.ui.model.RuntimeListItem in project kie-wb-common by kiegroup.
the class RuntimeServiceImplTest method getRuntimeItemByPipelineExecutionKeyExisting.
@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);
}
use of org.guvnor.ala.ui.model.RuntimeListItem in project kie-wb-common by kiegroup.
the class RuntimeServiceImplTest method testGetRuntimeItems.
@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);
}
use of org.guvnor.ala.ui.model.RuntimeListItem in project kie-wb-common by kiegroup.
the class ProvisioningScreensServiceImpl method getRuntimesInfo.
@Override
public RuntimesInfo getRuntimesInfo(final ProviderKey providerKey) {
checkNotNull("providerKey", providerKey);
final Provider provider = providerService.getProvider(providerKey);
if (provider == null) {
return null;
}
final Collection<RuntimeListItem> items = runtimeService.getRuntimeItems(providerKey);
return new RuntimesInfo(provider, items);
}
Aggregations