### Question:
PersistencePresenter extends Section<ProjectScreenModel> { @Override public Promise<Void> setup(final ProjectScreenModel model) { return setup(); } @Inject  PersistencePresenter(final View view,
                                final WorkspaceProjectContext projectContext,
                                final Promises promises,
                                final MenuItem<ProjectScreenModel> menuItem,
                                final Event<NotificationEvent> notificationEvent,
                                final Event<SettingsSectionChange<ProjectScreenModel>> settingsSectionChangeEvent,
                                final ManagedInstance<ObservablePath> observablePaths,
                                final Caller<PersistenceDescriptorEditorService> editorService,
                                final Caller<DataModelerService> dataModelerService,
                                final PropertiesListPresenter propertiesListPresenter,
                                final PersistableDataObjectsListPresenter persistableDataObjectsListPresenter); @Override Promise<Void> setup(final ProjectScreenModel model); @Override Promise<Object> validate(); @Override Promise<Void> save(final String comment,
                              final Supplier<Promise<Void>> chain); void add(final String className); void add(final Property property); void addAllProjectsPersistableDataObjects(); void setDataSource(final String dataSource); void setPersistenceUnit(final String persistenceUnit); void setPersistenceProvider(final String persistenceProvider); void addNewProperty(); void addNewPersistableDataObject(); @Override int currentHashCode(); @Override SectionView<?> getView();  }### Answer:
@Test public void testSetup() { final PersistenceDescriptorEditorContent model = spy(newPersistenceDescriptorEditorContent()); doReturn(model).when(editorService).loadContent(any(), anyBoolean()); persistencePresenter.setup(mock(ProjectScreenModel.class)).catch_(i -> { Assert.fail("Promise should've been resolved!"); return promises.resolve(); }); verify(view).init(eq(persistencePresenter)); verify(editorService).loadContent(any(), anyBoolean()); verify(propertiesListPresenter).setup(any(), any(), any()); verify(persistableDataObjectsListPresenter).setup(any(), any(), any()); verify(view).setPersistenceUnit(model.getDescriptorModel().getPersistenceUnit().getName()); verify(view).setPersistenceProvider(model.getDescriptorModel().getPersistenceUnit().getProvider()); verify(view).setDataSource(eq(model.getDescriptorModel().getPersistenceUnit().getJtaDataSource())); }
@Test public void testSetupFail() { final RuntimeException testException = new RuntimeException("Test exception"); doThrow(testException).when(editorService).loadContent(any(), anyBoolean()); persistencePresenter.setup(mock(ProjectScreenModel.class)).then(i -> { Assert.fail("Promise should've not been resolved!"); return promises.resolve(); }).catch_(o -> promises.catchOrExecute(o, e -> promises.resolve(), e -> { Assert.fail("RPC failed so default RPC error handler was called."); return promises.resolve(); })); }