/** * Tests the case when the item is a Runtime with no pipeline execution trace. */ @Test public void testSetupRuntimeWithNoTrace() { runtime = mockRuntime(); item = new RuntimeListItem(RUNTIME_NAME, runtime); presenter.setup(item); verify(pipelinePresenter, times(1)).clearStages(); verify(view, times(1)).setup(RUNTIME_NAME, CREATED_DATE, DEFAULT_PIPELINE_NAME); verify(view, times(1)).setEndpoint(ENDPOINT); verify(pipelinePresenter, never()).addStage(any(IsElement.class)); }
/** * Tests the case when the item is a Runtime with no pipeline execution trace. */ @Test public void testSetupRuntimeWithNoTrace() { runtime = mockRuntime(); item = new RuntimeListItem(RUNTIME_NAME, runtime); presenter.setup(item); verify(pipelinePresenter, times(1)).clearStages(); verify(view, times(1)).setup(RUNTIME_NAME, CREATED_DATE, DEFAULT_PIPELINE_NAME); verify(view, times(1)).setEndpoint(ENDPOINT); verify(pipelinePresenter, never()).addStage(any(IsElement.class)); }
/** * Tests the case when the item is a Runtime with pipeline execution trace. */ @Test public void testSetupRuntimeWithTrace() { runtime = mockRuntime(); preparePipelineExecutionTraceSetup(); item = new RuntimeListItem(RUNTIME_NAME, trace); //set the trace on the runtime. runtime.setPipelineTrace(trace); item = new RuntimeListItem(RUNTIME_NAME, runtime); presenter.setup(item); verify(pipelinePresenter, times(2)).clearStages(); verify(view, times(1)).setup(RUNTIME_NAME, CREATED_DATE, PIPELINE_NAME); verify(view, times(1)).setEndpoint(ENDPOINT); verifyPipelineWasSet(trace, displayableStages); }
/** * Tests the case when the item is a Runtime with pipeline execution trace. */ @Test public void testSetupRuntimeWithTrace() { runtime = mockRuntime(); preparePipelineExecutionTraceSetup(); item = new RuntimeListItem(RUNTIME_NAME, trace); //set the trace on the runtime. runtime.setPipelineTrace(trace); item = new RuntimeListItem(RUNTIME_NAME, runtime); presenter.setup(item); verify(pipelinePresenter, times(2)).clearStages(); verify(view, times(1)).setup(RUNTIME_NAME, CREATED_DATE, PIPELINE_NAME); verify(view, times(1)).setEndpoint(ENDPOINT); verifyPipelineWasSet(trace, displayableStages); }