Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#11878] Change institute length limit #12974

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/java/teammates/common/util/FieldValidator.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public final class FieldValidator {
public static final int SECTION_NAME_MAX_LENGTH = 60;

public static final String INSTITUTE_NAME_FIELD_NAME = "institute name";
public static final int INSTITUTE_NAME_MAX_LENGTH = 64;
public static final int INSTITUTE_NAME_MAX_LENGTH = 128;

// email-related
public static final String EMAIL_FIELD_NAME = "email";
Expand Down
9 changes: 5 additions & 4 deletions src/test/java/teammates/common/util/FieldValidatorTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -210,11 +210,12 @@ public void testGetInvalidityInfoForInstituteName_invalid_returnSpecificErrorStr
String invalidInstituteName = StringHelperExtension.generateStringOfLength(
FieldValidator.INSTITUTE_NAME_MAX_LENGTH + 1);
String actual = FieldValidator.getInvalidityInfoForInstituteName(invalidInstituteName);
String expectedTemplate = "\"%s\" is not "
+ "acceptable to TEAMMATES as a/an institute name because it is too long. The value "
+ "of a/an institute name should be no longer than 128 characters. It should not be empty.";
String expected = String.format(expectedTemplate, invalidInstituteName);
assertEquals("Invalid institute name (too long) should return error message that is specific to institute name",
"\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\" is not "
+ "acceptable to TEAMMATES as a/an institute name because it is too long. The value "
+ "of a/an institute name should be no longer than 64 characters. It should not be empty.",
actual);
expected, actual);
}

@Test
Expand Down
Loading