Package com.atlassian.jira.util
Class ErrorCollectionAssert
java.lang.Object
com.atlassian.jira.util.ErrorCollectionAssert
Provides methods to help unit tests make assertions about ErrorCollection objects.
- Since:
- v3.13
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
assert1ErrorMessage
(ErrorCollection errorCollection, String expectedErrorMessage) Asserts that the given ErrorCollection contains only the given error message.static void
assert1FieldError
(ErrorCollection errorCollection, String fieldName, String expectedErrorMessage) Asserts that the given ErrorCollection contains only the given field-specific error.static void
assertFieldError
(ErrorCollection errorCollection, String fieldName, String expectedErrorMessage) Asserts that the given ErrorCollection contains the given field-specific error.static void
assertNoErrors
(ErrorCollection errorCollection) Asserts that the given ErrorCollection has no errors.
-
Constructor Details
-
ErrorCollectionAssert
public ErrorCollectionAssert()
-
-
Method Details
-
assert1ErrorMessage
public static void assert1ErrorMessage(ErrorCollection errorCollection, String expectedErrorMessage) Asserts that the given ErrorCollection contains only the given error message.- Parameters:
errorCollection
- ErrorCollection under test.expectedErrorMessage
- The expected error message.
-
assert1FieldError
public static void assert1FieldError(ErrorCollection errorCollection, String fieldName, String expectedErrorMessage) Asserts that the given ErrorCollection contains only the given field-specific error.- Parameters:
errorCollection
- ErrorCollection under test.fieldName
- The field name that we expected the error for.expectedErrorMessage
- The expected error message.
-
assertFieldError
public static void assertFieldError(ErrorCollection errorCollection, String fieldName, String expectedErrorMessage) Asserts that the given ErrorCollection contains the given field-specific error.- Parameters:
errorCollection
- ErrorCollection under test.fieldName
- The field name that we expected the error for.expectedErrorMessage
- The expected error message.
-
assertNoErrors
Asserts that the given ErrorCollection has no errors.- Parameters:
errorCollection
- ErrorCollection under test.
-