NamedObjectItemPresenter extends ListItemPresenter<ItemObjectModel, Section<?>, NamedObjectItemPresenter.View> implements ObjectPresenter { @Override public NamedObjectItemPresenter setup(final ItemObjectModel model, final Section<?> parentPresenter) { this.model = model; this.parentPresenter = parentPresenter; if (model.getParameters() == null) { model.setParameters(new ArrayList<>()); } parametersModal.setup(model.getParameters(), this); view.setupResolverSelect(model, parentPresenter); view.init(this); view.setName(model.getName()); view.setValue(model.getValue()); view.setParametersCount(model.getParameters().size()); return this; } @Inject  NamedObjectItemPresenter(final View view,
                                    final ParametersModal parametersModal); @Override NamedObjectItemPresenter setup(final ItemObjectModel model,
                                          final Section<?> parentPresenter); @Override void remove(); void onNameChange(final String name); void onValueChange(String value); @Override void fireChangeEvent(); void showParametersModal(); @Override ItemObjectModel getObject(); @Override void signalParameterAddedOrRemoved();  }
@Test public void testSetup() { final ItemObjectModel model = spy(new ItemObjectModel("Name", "Value", "mvel", ImmutableList.of(new Parameter("Foo", "Bar")))); namedObjectItemPresenter.setup(model, mock(DeploymentsSectionPresenter.class)); verify(model, never()).setParameters(any()); verify(view).setupResolverSelect(any(), any()); verify(view).init(eq(namedObjectItemPresenter)); verify(view).setValue(eq("Value")); verify(view).setName(eq("Name")); verify(view).setParametersCount(eq(1)); verify(parametersModal).setup(any(), any()); }