@Test public void getErrorTextShouldReturnNullWhenNameIsValid() throws Exception { final String actual = underTest.getErrorText("Test"); assertThat(actual) .overridingErrorMessage("Expected value returned by getErrorText is null, but was <%s>", actual) .isNull(); }
@Nullable @Override public String getErrorText(@Nullable String name) { if (nameHelper.isQualifiedName(name)) { return null; } return bundle.message("error.message.validator.name.invalid"); }
NameValidator implements InputValidatorEx { @Nullable @Override public String getErrorText(@Nullable String name) { if (nameHelper.isQualifiedName(name)) { return null; } return bundle.message("error.message.validator.name.invalid"); } }
NameValidator implements InputValidatorEx { @Nullable @Override public String getErrorText(@Nullable String name) { if (nameHelper.isQualifiedName(name)) { return null; } return bundle.message("error.message.validator.name.invalid"); } @Inject  NameValidator(@Nonnull Json2JavaBundle bundle, @Nonnull PsiNameHelper nameHelper); }
NameValidator implements InputValidatorEx { @Nullable @Override public String getErrorText(@Nullable String name) { if (nameHelper.isQualifiedName(name)) { return null; } return bundle.message("error.message.validator.name.invalid"); } @Inject  NameValidator(@Nonnull Json2JavaBundle bundle, @Nonnull PsiNameHelper nameHelper); @Nullable @Override String getErrorText(@Nullable String name); @Override boolean checkInput(@Nullable String name); @Override @SuppressWarnings("RedundantIfStatement") boolean canClose(@Nullable String name); }
NameValidator implements InputValidatorEx { @Nullable @Override public String getErrorText(@Nullable String name) { if (nameHelper.isQualifiedName(name)) { return null; } return bundle.message("error.message.validator.name.invalid"); } @Inject  NameValidator(@Nonnull Json2JavaBundle bundle, @Nonnull PsiNameHelper nameHelper); @Nullable @Override String getErrorText(@Nullable String name); @Override boolean checkInput(@Nullable String name); @Override @SuppressWarnings("RedundantIfStatement") boolean canClose(@Nullable String name);  }