ConfigPartAdapter implements ConfigPart { @Override public boolean hasError() { for (ConfigProblem configProblem : getConfigProblems()) { if (configProblem.isError()) { return true; } } return false; } ConfigPartAdapter(@NotNull @Nls(capitalization = Nls.Capitalization.Title) String sourceName); @Nls @NotNull @Override String getSourceName(); @Override boolean hasServerNameSet(); @Nullable @Override P4ServerName getServerName(); @Override boolean hasClientnameSet(); @Nullable @Override String getClientname(); @Override boolean hasUsernameSet(); @Nullable @Override String getUsername(); @Override boolean hasPasswordSet(); @Nullable @Override String getPlaintextPassword(); @Override boolean hasAuthTicketFileSet(); @Nullable @Override File getAuthTicketFile(); @Override boolean hasTrustTicketFileSet(); @Nullable @Override File getTrustTicketFile(); @Override boolean hasServerFingerprintSet(); @Nullable @Override String getServerFingerprint(); @Override boolean hasClientHostnameSet(); @Nullable @Override String getClientHostname(); @Override boolean hasIgnoreFileNameSet(); @Nullable @Override String getIgnoreFileName(); @Override boolean hasDefaultCharsetSet(); @Nullable @Override String getDefaultCharset(); @Override boolean hasLoginSsoSet(); @Nullable @Override String getLoginSso(); @Override String toString(); @Override boolean reload(); @NotNull @Override Collection<ConfigProblem> getConfigProblems(); @Override boolean hasError(); @Override String getRawPort(); @NotNull @Override ConfigPart copy(); @Override boolean requiresUserEnteredPassword();  }
@Test void hasError_default() { assertFalse(new ConfigPartAdapter("Blah").hasError()); }
@Test void hasError_noProblems() { assertFalse(new ProblemConfigPartAdapter().hasError()); }
@Test void hasError_oneProblem_NotError() { assertFalse(new ProblemConfigPartAdapter( createWarning() ).hasError()); }
@Test void hasError_oneProblem_Error() { assertTrue(new ProblemConfigPartAdapter( createError() ).hasError()); }
@Test void hasError_multipleProblems_NotError() { assertFalse(new ProblemConfigPartAdapter( createWarning(), createWarning(),createWarning(), createWarning() ).hasError()); }
@Test void hasError_multipleProblems_FirstError() { assertTrue(new ProblemConfigPartAdapter( createError(), createWarning(),createWarning(), createWarning(), createWarning() ).hasError()); }
@Test void hasError_multipleProblems_LastError() { assertTrue(new ProblemConfigPartAdapter( createWarning(), createWarning(),createWarning(), createWarning(), createError() ).hasError()); }
@Test void hasError_multipleProblems_AllErrors() { assertTrue(new ProblemConfigPartAdapter( createError(), createError(),createError(), createError() ).hasError()); }