private RemoteCallback<RuntimeListItem> getLoadItemSuccessCallback() { return runtimeListItem -> { if (runtimeListItem != null) { setup(runtimeListItem); } }; }
private RemoteCallback<RuntimeListItem> getLoadItemSuccessCallback() { return runtimeListItem -> { if (runtimeListItem != null) { setup(runtimeListItem); } }; }
public void setupItems(final Collection<RuntimeListItem> response) { clear(); response.forEach(item -> { final RuntimePresenter runtimePresenter = newRuntimePresenter(); runtimePresenter.setup(item); currentItems.add(runtimePresenter); view.addListItem(runtimePresenter.getView()); }); }
public void setupItems(final Collection<RuntimeListItem> response) { clear(); response.forEach(item -> { final RuntimePresenter runtimePresenter = newRuntimePresenter(); runtimePresenter.setup(item); currentItems.add(runtimePresenter); view.addListItem(runtimePresenter.getView()); }); }
private void preparePipeline() { trace = mockPipelineExecutionTrace(EXECUTION_ID, mockPipeline(PIPELINE_NAME, STAGE_NUMBER), mock(PipelineStatus.class), mock(PipelineStatus.class)); item = new RuntimeListItem(RUNTIME_NAME, trace); presenter.setup(item); } }
private void prepareRuntime() { runtime = mockRuntime(); item = new RuntimeListItem(RUNTIME_NAME, runtime); presenter.setup(item); }
private void preparePipeline() { trace = mockPipelineExecutionTrace(EXECUTION_ID, mockPipeline(PIPELINE_NAME, STAGE_NUMBER), mock(PipelineStatus.class), mock(PipelineStatus.class)); item = new RuntimeListItem(RUNTIME_NAME, trace); presenter.setup(item); } }
private void prepareRuntime() { runtime = mockRuntime(); item = new RuntimeListItem(RUNTIME_NAME, runtime); presenter.setup(item); }
@Test public void testSetupItems() { List<RuntimeListItem> items = mockItems(ITEMS_COUNT); presenter.setupItems(items); verify(runtimePresenterInstance, times(ITEMS_COUNT)).get(); verify(view, times(ITEMS_COUNT)).addListItem(any()); for (int i = 0; i < ITEMS_COUNT; i++) { verify(runtimePresenters.get(i), times(1)).setup(items.get(i)); verify(view, times(1)).addListItem(runtimePresenters.get(i).getView()); } }
@Test public void testSetupItems() { List<RuntimeListItem> items = mockItems(ITEMS_COUNT); presenter.setupItems(items); verify(runtimePresenterInstance, times(ITEMS_COUNT)).get(); verify(view, times(ITEMS_COUNT)).addListItem(any()); for (int i = 0; i < ITEMS_COUNT; i++) { verify(runtimePresenters.get(i), times(1)).setup(items.get(i)); verify(view, times(1)).addListItem(runtimePresenters.get(i).getView()); } }
@Test public void testOnOtherPipelineExecutionStopped() { preparePipelineExecutionTraceSetup(); PipelineExecutionTraceKey otherKey = mock(PipelineExecutionTraceKey.class); RuntimeListItem item = new RuntimeListItem(RUNTIME_NAME, trace); presenter.setup(item); presenter.onPipelineExecutionChange(new PipelineExecutionChangeEvent(PipelineExecutionChange.STOPPED, otherKey)); verify(presenter, never()).refresh(any(PipelineExecutionTraceKey.class)); }
@Test public void testOnOtherPipelineExecutionStopped() { preparePipelineExecutionTraceSetup(); PipelineExecutionTraceKey otherKey = mock(PipelineExecutionTraceKey.class); RuntimeListItem item = new RuntimeListItem(RUNTIME_NAME, trace); presenter.setup(item); presenter.onPipelineExecutionChange(new PipelineExecutionChangeEvent(PipelineExecutionChange.STOPPED, otherKey)); verify(presenter, never()).refresh(any(PipelineExecutionTraceKey.class)); }
private void prepareRuntimeActionsSetupTest(final String status) { runtime = mockRuntime(); runtime.setStatus(status); item = new RuntimeListItem(RUNTIME_NAME, runtime); presenter.setup(item); }
private void preparePipelineActionsSetupTest(final PipelineStatus status) { preparePipelineExecutionTraceSetup(); trace.setPipelineStatus(status); RuntimeListItem item = new RuntimeListItem(RUNTIME_NAME, trace); presenter.setup(item); }
private void preparePipelineActionsSetupTest(final PipelineStatus status) { preparePipelineExecutionTraceSetup(); trace.setPipelineStatus(status); RuntimeListItem item = new RuntimeListItem(RUNTIME_NAME, trace); presenter.setup(item); }
private void prepareRuntimeActionsSetupTest(final String status) { runtime = mockRuntime(); runtime.setStatus(status); item = new RuntimeListItem(RUNTIME_NAME, runtime); presenter.setup(item); }
@Test public void testOnCurrentPipelineExecutionStopped() { preparePipelineExecutionTraceSetup(); PipelineExecutionTraceKey currentKey = trace.getKey(); RuntimeListItem item = new RuntimeListItem(RUNTIME_NAME, trace); presenter.setup(item); presenter.onPipelineExecutionChange(new PipelineExecutionChangeEvent(PipelineExecutionChange.STOPPED, currentKey)); verify(presenter, times(1)).refresh(currentKey); }
@Test public void testOnCurrentPipelineExecutionStopped() { preparePipelineExecutionTraceSetup(); PipelineExecutionTraceKey currentKey = trace.getKey(); RuntimeListItem item = new RuntimeListItem(RUNTIME_NAME, trace); presenter.setup(item); presenter.onPipelineExecutionChange(new PipelineExecutionChangeEvent(PipelineExecutionChange.STOPPED, currentKey)); verify(presenter, times(1)).refresh(currentKey); }
@Test public void testOnPipelineStatusChange() { preparePipelineExecutionTraceSetup(); RuntimeListItem item = new RuntimeListItem(RUNTIME_NAME, trace); //setup the presenter. presenter.setup(item); //the pipeline finishes presenter.onPipelineStatusChange(new PipelineStatusChangeEvent(trace.getKey(), PipelineStatus.FINISHED)); verify(view, times(1)).setStatus(RuntimePresenterHelper.buildIconStyle(PipelineStatus.FINISHED)); }
@Test public void testOnPipelineStatusChange() { preparePipelineExecutionTraceSetup(); RuntimeListItem item = new RuntimeListItem(RUNTIME_NAME, trace); //setup the presenter. presenter.setup(item); //the pipeline finishes presenter.onPipelineStatusChange(new PipelineStatusChangeEvent(trace.getKey(), PipelineStatus.FINISHED)); verify(view, times(1)).setStatus(RuntimePresenterHelper.buildIconStyle(PipelineStatus.FINISHED)); }