use of org.guvnor.ala.ui.model.PipelineExecutionTraceKey in project kie-wb-common by kiegroup.
the class ProviderPresenterTest method testPipelineExecutionDeletedRefreshRequired.
@Test
public void testPipelineExecutionDeletedRefreshRequired() {
// load the presenter.
prepareRuntimesInfo();
when(runtimeItems.isEmpty()).thenReturn(true);
presenter.onProviderSelected(new ProviderSelectedEvent(providerKey));
PipelineExecutionTraceKey pipelineExecutionTraceKey = mock(PipelineExecutionTraceKey.class);
when(providerStatusPresenter.removeItem(pipelineExecutionTraceKey)).thenReturn(true);
// the status presenter is empty after the removal.
when(providerStatusPresenter.isEmpty()).thenReturn(true);
presenter.onPipelineExecutionChange(new PipelineExecutionChangeEvent(PipelineExecutionChange.DELETED, pipelineExecutionTraceKey));
verify(providerStatusPresenter, times(1)).removeItem(pipelineExecutionTraceKey);
verify(presenter, times(1)).refresh();
}
use of org.guvnor.ala.ui.model.PipelineExecutionTraceKey in project kie-wb-common by kiegroup.
the class ProviderStatusPresenterTest method testRemoveNonExistingPipelineExecution.
@Test
public void testRemoveNonExistingPipelineExecution() {
PipelineExecutionTraceKey keyToRemove = mock(PipelineExecutionTraceKey.class);
List<RuntimeListItem> items = mockItems(ITEMS_COUNT);
presenter.setupItems(items);
for (int i = 0; i < ITEMS_COUNT; i++) {
when(runtimePresenters.get(i).getItem()).thenReturn(items.get(i));
}
assertFalse(presenter.removeItem(keyToRemove));
verify(runtimePresenterInstance, never()).destroy(anyObject());
verify(view, never()).removeListItem(anyObject());
}
use of org.guvnor.ala.ui.model.PipelineExecutionTraceKey in project kie-wb-common by kiegroup.
the class RuntimePresenterActionsTest method testDeletePipelineConfirmYesAndSuccessful.
@Test
public void testDeletePipelineConfirmYesAndSuccessful() {
preparePipelineDelete();
PipelineExecutionTraceKey currentKey = trace.getKey();
when(translationService.format(RuntimePresenter_PipelineExecutionDeleteSuccessMessage, currentKey.getId())).thenReturn(SUCCESS_MESSAGE);
yesCommandCaptor.getValue().execute();
verify(runtimeService, times(1)).deletePipelineExecution(currentKey);
verify(notificationEvent, times(1)).fire(new NotificationEvent(SUCCESS_MESSAGE, NotificationEvent.NotificationType.SUCCESS));
}
use of org.guvnor.ala.ui.model.PipelineExecutionTraceKey in project kie-wb-common by kiegroup.
the class RuntimePresenterTest method mockPipelineExecutionTrace.
protected PipelineExecutionTrace mockPipelineExecutionTrace(String executionId, Pipeline pipeline, PipelineStatus initialPipelineStatus, PipelineStatus initialStagesStatus) {
PipelineExecutionTrace trace = new PipelineExecutionTrace(new PipelineExecutionTraceKey(executionId));
trace.setPipeline(pipeline);
trace.setPipelineStatus(initialPipelineStatus);
pipeline.getStages().forEach(stage -> trace.setStageStatus(stage.getName(), initialStagesStatus));
return trace;
}
use of org.guvnor.ala.ui.model.PipelineExecutionTraceKey in project kie-wb-common by kiegroup.
the class RuntimeServiceImplTest method testStopPipelineExecution.
@Test
public void testStopPipelineExecution() {
PipelineExecutionTraceKey pipelineExecutionTraceKey = new PipelineExecutionTraceKey(PIPELINE_EXECUTION_ID);
service.stopPipelineExecution(pipelineExecutionTraceKey);
verify(pipelineService, times(1)).stopPipelineExecution(PIPELINE_EXECUTION_ID);
verify(pipelineExecutionChangeEvent, times(1)).fire(new PipelineExecutionChangeEvent(PipelineExecutionChange.STOPPED, pipelineExecutionTraceKey));
}
Aggregations