@Test public void testValidateStringIsNotEmpty() { generalSettingsPresenter.validateStringIsNotEmpty("NotEmptyString", "Message").then(e -> { Assert.assertEquals(e, true); return promises.resolve(); }).catch_(e -> { Assert.fail("Promise should've been resolved!"); return promises.resolve(); }); }
Promise<Boolean> validateStringIsNotEmpty(final String string, final String errorMessage) { return promises.create((resolve, reject) -> { if (string == null || string.isEmpty()) { reject.onInvoke(errorMessage); } else { resolve.onInvoke(true); } }); }
GeneralSettingsPresenter extends Section<ProjectScreenModel> { Promise<Boolean> validateStringIsNotEmpty(final String string, final String errorMessage) { return promises.create((resolve, reject) -> { if (string == null || string.isEmpty()) { reject.onInvoke(errorMessage); } else { resolve.onInvoke(true); } }); } }
GeneralSettingsPresenter extends Section<ProjectScreenModel> { Promise<Boolean> validateStringIsNotEmpty(final String string, final String errorMessage) { return promises.create((resolve, reject) -> { if (string == null || string.isEmpty()) { reject.onInvoke(errorMessage); } else { resolve.onInvoke(true); } }); } @Inject  GeneralSettingsPresenter(final View view,
                                    final Promises promises,
                                    final MenuItem<ProjectScreenModel> menuItem,
                                    final Caller<ValidationService> validationService,
                                    final Caller<WorkspaceProjectService> projectService,
                                    final Event<SettingsSectionChange<ProjectScreenModel>> settingsSectionChangeEvent,
                                    final GAVPreferences gavPreferences,
                                    final ProjectScopedResolutionStrategySupplier projectScopedResolutionStrategySupplier,
                                    final GitUrlsPresenter gitUrlsPresenter,
                                    final LibraryPlaces libraryPlaces); }
GeneralSettingsPresenter extends Section<ProjectScreenModel> { Promise<Boolean> validateStringIsNotEmpty(final String string, final String errorMessage) { return promises.create((resolve, reject) -> { if (string == null || string.isEmpty()) { reject.onInvoke(errorMessage); } else { resolve.onInvoke(true); } }); } @Inject  GeneralSettingsPresenter(final View view,
                                    final Promises promises,
                                    final MenuItem<ProjectScreenModel> menuItem,
                                    final Caller<ValidationService> validationService,
                                    final Caller<WorkspaceProjectService> projectService,
                                    final Event<SettingsSectionChange<ProjectScreenModel>> settingsSectionChangeEvent,
                                    final GAVPreferences gavPreferences,
                                    final ProjectScopedResolutionStrategySupplier projectScopedResolutionStrategySupplier,
                                    final GitUrlsPresenter gitUrlsPresenter,
                                    final LibraryPlaces libraryPlaces); @Override Promise<Void> setup(final ProjectScreenModel model); @Override Promise<Object> validate(); @Override Promise<Void> save(final String comment,
                              final Supplier<Promise<Void>> chain); @Override int currentHashCode(); GitUrlsPresenter getGitUrlsPresenter(); @Override SectionView<?> getView(); }
GeneralSettingsPresenter extends Section<ProjectScreenModel> { Promise<Boolean> validateStringIsNotEmpty(final String string, final String errorMessage) { return promises.create((resolve, reject) -> { if (string == null || string.isEmpty()) { reject.onInvoke(errorMessage); } else { resolve.onInvoke(true); } }); } @Inject  GeneralSettingsPresenter(final View view,
                                    final Promises promises,
                                    final MenuItem<ProjectScreenModel> menuItem,
                                    final Caller<ValidationService> validationService,
                                    final Caller<WorkspaceProjectService> projectService,
                                    final Event<SettingsSectionChange<ProjectScreenModel>> settingsSectionChangeEvent,
                                    final GAVPreferences gavPreferences,
                                    final ProjectScopedResolutionStrategySupplier projectScopedResolutionStrategySupplier,
                                    final GitUrlsPresenter gitUrlsPresenter,
                                    final LibraryPlaces libraryPlaces); @Override Promise<Void> setup(final ProjectScreenModel model); @Override Promise<Object> validate(); @Override Promise<Void> save(final String comment,
                              final Supplier<Promise<Void>> chain); @Override int currentHashCode(); GitUrlsPresenter getGitUrlsPresenter(); @Override SectionView<?> getView();  }