@Test public void testIsValid() { when( view.getTemplateName() ).thenReturn( "templateName", "", "templateName" ); when( view.isRuleCapabilityChecked() ).thenReturn( true, false ); when( view.isProcessCapabilityChecked() ).thenReturn( true, false ); when( view.isPlanningCapabilityChecked() ).thenReturn( false ); assertTrue( presenter.isValid() ); verify( view ).noErrorOnTemplateName(); verify( view ).noErrorOnCapability(); assertFalse( presenter.isValid() ); verify( view ).errorOnTemplateName(); verify( view, times( 2 ) ).noErrorOnCapability(); assertFalse( presenter.isValid() ); verify( view, times( 2 ) ).noErrorOnTemplateName(); verify( view ).errorCapability(); }
public boolean isValid() { boolean hasError = false; if (isTemplateNameValid()) { view.noErrorOnTemplateName(); } else { view.errorOnTemplateName(); hasError = true; } if (isCapabilityValid()) { view.noErrorOnCapability(); } else { view.errorCapability(); hasError = true; } return !hasError; }
NewTemplatePresenter implements WizardPage { public boolean isValid() { boolean hasError = false; if (isTemplateNameValid()) { view.noErrorOnTemplateName(); } else { view.errorOnTemplateName(); hasError = true; } if (isCapabilityValid()) { view.noErrorOnCapability(); } else { view.errorCapability(); hasError = true; } return !hasError; } }
NewTemplatePresenter implements WizardPage { public boolean isValid() { boolean hasError = false; if (isTemplateNameValid()) { view.noErrorOnTemplateName(); } else { view.errorOnTemplateName(); hasError = true; } if (isCapabilityValid()) { view.noErrorOnCapability(); } else { view.errorCapability(); hasError = true; } return !hasError; } @Inject  NewTemplatePresenter(final View view,
                                final Caller<SpecManagementService> specManagementService,
                                final Event<WizardPageStatusChangeEvent> wizardPageStatusChangeEvent); }
NewTemplatePresenter implements WizardPage { public boolean isValid() { boolean hasError = false; if (isTemplateNameValid()) { view.noErrorOnTemplateName(); } else { view.errorOnTemplateName(); hasError = true; } if (isCapabilityValid()) { view.noErrorOnCapability(); } else { view.errorCapability(); hasError = true; } return !hasError; } @Inject  NewTemplatePresenter(final View view,
                                final Caller<SpecManagementService> specManagementService,
                                final Event<WizardPageStatusChangeEvent> wizardPageStatusChangeEvent); boolean hasProcessCapability(); String getTemplateName(); @PostConstruct void init(); @Override String getTitle(); @Override void isComplete(final Callback<Boolean> callback); void addContentChangeHandler(final ContentChangeHandler contentChangeHandler); @Override void initialise(); @Override void prepareView(); @Override Widget asWidget(); boolean isValid(); boolean isTemplateNameValid(); boolean isCapabilityValid(); void clear(); boolean isRuleCapabilityChecked(); boolean isProcessCapabilityChecked(); boolean isPlanningCapabilityChecked(); View getView(); }
NewTemplatePresenter implements WizardPage { public boolean isValid() { boolean hasError = false; if (isTemplateNameValid()) { view.noErrorOnTemplateName(); } else { view.errorOnTemplateName(); hasError = true; } if (isCapabilityValid()) { view.noErrorOnCapability(); } else { view.errorCapability(); hasError = true; } return !hasError; } @Inject  NewTemplatePresenter(final View view,
                                final Caller<SpecManagementService> specManagementService,
                                final Event<WizardPageStatusChangeEvent> wizardPageStatusChangeEvent); boolean hasProcessCapability(); String getTemplateName(); @PostConstruct void init(); @Override String getTitle(); @Override void isComplete(final Callback<Boolean> callback); void addContentChangeHandler(final ContentChangeHandler contentChangeHandler); @Override void initialise(); @Override void prepareView(); @Override Widget asWidget(); boolean isValid(); boolean isTemplateNameValid(); boolean isCapabilityValid(); void clear(); boolean isRuleCapabilityChecked(); boolean isProcessCapabilityChecked(); boolean isPlanningCapabilityChecked(); View getView();  }