DeploymentsRequiredRolesPresenter extends Section<DeploymentDescriptorModel> { @Override public Promise<Void> setup(final DeploymentDescriptorModel model) { if (model.getRequiredRoles() == null) { model.setRequiredRoles(new ArrayList<>()); } requiredRolesListPresenter.setup( view.getRequiredRolesTable(), model.getRequiredRoles(), (requiredRole, presenter) -> presenter.setup(requiredRole, this)); return promises.resolve(); } @Inject  DeploymentsRequiredRolesPresenter(final Event<SettingsSectionChange<DeploymentDescriptorModel>> settingsSectionChangeEvent,
                                             final MenuItem<DeploymentDescriptorModel> menuItem,
                                             final Promises promises,
                                             final DeploymentsRequiredRolesView view,
                                             final RequiredRolesListPresenter requiredRolesListPresenter); @PostConstruct void init(); @Override Promise<Void> setup(final DeploymentDescriptorModel model); void addNewRequiredRole(); @Override SectionView<?> getView(); @Override int currentHashCode();  }
@Test public void testSetup() { final DeploymentDescriptorModel model = new DeploymentDescriptorModel(); presenter.setup(model); assertNotNull(model.getRequiredRoles()); verify(requiredRolesListPresenter).setup(any(), any(), any()); }