@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()); } }
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()); }); }
ProviderStatusPresenter { 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()); }); } }
ProviderStatusPresenter { 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()); }); } @Inject  ProviderStatusPresenter(final View view,
                                   final ManagedInstance<RuntimePresenter> runtimePresenterInstance); }
ProviderStatusPresenter { 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()); }); } @Inject  ProviderStatusPresenter(final View view,
                                   final ManagedInstance<RuntimePresenter> runtimePresenterInstance); @PostConstruct void init(); void setupItems(final Collection<RuntimeListItem> response); boolean removeItem(final RuntimeKey runtimeKey); boolean removeItem(final PipelineExecutionTraceKey pipelineExecutionTraceKey); boolean isEmpty(); void clear(); View getView(); }
ProviderStatusPresenter { 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()); }); } @Inject  ProviderStatusPresenter(final View view,
                                   final ManagedInstance<RuntimePresenter> runtimePresenterInstance); @PostConstruct void init(); void setupItems(final Collection<RuntimeListItem> response); boolean removeItem(final RuntimeKey runtimeKey); boolean removeItem(final PipelineExecutionTraceKey pipelineExecutionTraceKey); boolean isEmpty(); void clear(); View getView();  }