use of org.guvnor.ala.ui.model.RuntimeListItem in project kie-wb-common by kiegroup.
the class RuntimeListItemBuilderTest method testBuildRuntimeWithPipelineExecution.
@Test
public void testBuildRuntimeWithPipelineExecution() {
prepareRuntime();
preparePipelineTrace();
RuntimeListItem result = RuntimeListItemBuilder.newInstance().withItem(queryResultItem).build();
assertTrue(result.isRuntime());
assertNotNull(result.getRuntime());
assertNotNull(result.getRuntime().getPipelineTrace());
assertNull(result.getPipelineTrace());
assertRuntime(result.getRuntime());
assertPipelineTrace(result.getRuntime().getPipelineTrace());
}
use of org.guvnor.ala.ui.model.RuntimeListItem in project kie-wb-common by kiegroup.
the class RuntimeServiceImplTest method getRuntimeItemByRuntimeKeyNotExisting.
@Test
public void getRuntimeItemByRuntimeKeyNotExisting() {
ProviderKey providerKey = mock(ProviderKey.class);
RuntimeKey runtimeKey = new RuntimeKey(providerKey, RUNTIME_ID);
List<RuntimeQueryResultItem> singleResult = new ArrayList<>();
when(runtimeProvisioningService.executeQuery(any(RuntimeQuery.class))).thenReturn(singleResult);
RuntimeListItem result = service.getRuntimeItem(runtimeKey);
assertNull(result);
}
use of org.guvnor.ala.ui.model.RuntimeListItem in project kie-wb-common by kiegroup.
the class RuntimeServiceImplTest method getRuntimeItemByRuntimeKeyExisting.
@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);
}
use of org.guvnor.ala.ui.model.RuntimeListItem in project kie-wb-common by kiegroup.
the class RuntimeServiceImplTest method getRuntimeItemByPipelineExecutionKeyNotExisting.
@Test
public void getRuntimeItemByPipelineExecutionKeyNotExisting() {
PipelineExecutionTraceKey traceKey = new PipelineExecutionTraceKey(PIPELINE_EXECUTION_ID);
List<RuntimeQueryResultItem> singleResult = new ArrayList<>();
when(runtimeProvisioningService.executeQuery(any(RuntimeQuery.class))).thenReturn(singleResult);
RuntimeListItem result = service.getRuntimeItem(traceKey);
assertNull(result);
}
Aggregations