@Test public void testAddAllProjectsPersistableDataObjects() { persistencePresenter.persistenceDescriptorEditorContent = newPersistenceDescriptorEditorContent(); doReturn(Arrays.asList("NewClass1", "NewClass2")).when(dataModelerService).findPersistableClasses(any()); persistencePresenter.addAllProjectsPersistableDataObjects(); verify(dataModelerService).findPersistableClasses(any()); verify(persistencePresenter, never()).add(eq("Class1")); verify(persistencePresenter).add(eq("NewClass1")); verify(persistencePresenter).add(eq("NewClass1")); }
public void addAllProjectsPersistableDataObjects() { promises.promisify(dataModelerService, s -> { return s.findPersistableClasses(pathToPersistenceXml); }).then(classes -> { classes.stream() .filter(clazz -> !getPersistenceUnitModel().getClasses().contains(clazz)) .forEach(this::add); return promises.resolve(); }); }
PersistencePresenter extends Section<ProjectScreenModel> { public void addAllProjectsPersistableDataObjects() { promises.promisify(dataModelerService, s -> { return s.findPersistableClasses(pathToPersistenceXml); }).then(classes -> { classes.stream() .filter(clazz -> !getPersistenceUnitModel().getClasses().contains(clazz)) .forEach(this::add); return promises.resolve(); }); } }
PersistencePresenter extends Section<ProjectScreenModel> { public void addAllProjectsPersistableDataObjects() { promises.promisify(dataModelerService, s -> { return s.findPersistableClasses(pathToPersistenceXml); }).then(classes -> { classes.stream() .filter(clazz -> !getPersistenceUnitModel().getClasses().contains(clazz)) .forEach(this::add); return promises.resolve(); }); } @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); }
PersistencePresenter extends Section<ProjectScreenModel> { public void addAllProjectsPersistableDataObjects() { promises.promisify(dataModelerService, s -> { return s.findPersistableClasses(pathToPersistenceXml); }).then(classes -> { classes.stream() .filter(clazz -> !getPersistenceUnitModel().getClasses().contains(clazz)) .forEach(this::add); return promises.resolve(); }); } @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(); }
PersistencePresenter extends Section<ProjectScreenModel> { public void addAllProjectsPersistableDataObjects() { promises.promisify(dataModelerService, s -> { return s.findPersistableClasses(pathToPersistenceXml); }).then(classes -> { classes.stream() .filter(clazz -> !getPersistenceUnitModel().getClasses().contains(clazz)) .forEach(this::add); return promises.resolve(); }); } @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();  }