Class AbstractBindingResultAssert<SELF extends AbstractBindingResultAssert<SELF>>
java.lang.Object
org.assertj.core.api.AbstractAssert<SELF,BindingResult>
org.springframework.test.validation.AbstractBindingResultAssert<SELF>
- Type Parameters:
SELF
- the type of assertions
- All Implemented Interfaces:
org.assertj.core.api.Assert<SELF,
,BindingResult> org.assertj.core.api.Descriptable<SELF>
,org.assertj.core.api.ExtensionPoints<SELF,
BindingResult>
public abstract class AbstractBindingResultAssert<SELF extends AbstractBindingResultAssert<SELF>>
extends org.assertj.core.api.AbstractAssert<SELF,BindingResult>
AssertJ
assertions
that can be applied to
BindingResult
.- Since:
- 6.2
- Author:
- Stephane Nicoll
-
Field Summary
Fields inherited from class org.assertj.core.api.AbstractAssert
actual, info, myself, objects, throwUnsupportedExceptionOnEquals
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractBindingResultAssert
(String name, BindingResult bindingResult, Class<?> selfType) -
Method Summary
Modifier and TypeMethodDescriptionhasErrorsCount
(int expected) Verify that the total number of errors is equal to the expected value.hasFieldErrorCode
(String fieldName, String errorCode) Verify that the field with the givenfieldName
has an error matching the givenerrorCode
.hasFieldErrors
(String... fieldNames) Verify that the actual binding result contains fields in error with the givenfieldNames
.hasOnlyFieldErrors
(String... fieldNames) Verify that the actual binding result contains only fields in error with the givenfieldNames
, and nothing else.protected AssertionError
unexpectedBindingResult
(String reason, Object... arguments) Methods inherited from class org.assertj.core.api.AbstractAssert
areEqual, asInstanceOf, asList, assertionError, asString, describedAs, descriptionText, doesNotHave, doesNotHaveSameClassAs, doesNotHaveSameHashCodeAs, doesNotHaveToString, doesNotHaveToString, equals, extracting, extracting, failure, failureWithActualExpected, failWithActualExpectedAndMessage, failWithMessage, getWritableAssertionInfo, has, hashCode, hasSameClassAs, hasSameHashCodeAs, hasToString, hasToString, inBinary, inHexadecimal, is, isElementOfCustomAssert, isEqualTo, isExactlyInstanceOf, isIn, isIn, isInstanceOf, isInstanceOfAny, isInstanceOfSatisfying, isNot, isNotEqualTo, isNotExactlyInstanceOf, isNotIn, isNotIn, isNotInstanceOf, isNotInstanceOfAny, isNotNull, isNotOfAnyClassIn, isNotSameAs, isNull, isOfAnyClassIn, isSameAs, matches, matches, newListAssertInstance, overridingErrorMessage, overridingErrorMessage, satisfies, satisfies, satisfies, satisfiesAnyOf, satisfiesAnyOf, satisfiesAnyOfForProxy, satisfiesForProxy, setCustomRepresentation, setDescriptionConsumer, setPrintAssertionsDescription, throwAssertionError, usingComparator, usingComparator, usingDefaultComparator, usingRecursiveAssertion, usingRecursiveAssertion, usingRecursiveComparison, usingRecursiveComparison, withFailMessage, withFailMessage, withRepresentation, withThreadDumpOnError
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.assertj.core.api.Descriptable
as, as, as, describedAs, describedAs
-
Constructor Details
-
AbstractBindingResultAssert
-
-
Method Details
-
hasErrorsCount
Verify that the total number of errors is equal to the expected value.- Parameters:
expected
- the expected number of errors
-
hasFieldErrors
Verify that the actual binding result contains fields in error with the givenfieldNames
.- Parameters:
fieldNames
- the names of fields that should be in error
-
hasOnlyFieldErrors
Verify that the actual binding result contains only fields in error with the givenfieldNames
, and nothing else.- Parameters:
fieldNames
- the exhaustive list of field names that should be in error
-
hasFieldErrorCode
Verify that the field with the givenfieldName
has an error matching the givenerrorCode
.- Parameters:
fieldName
- the name of a field in errorerrorCode
- the error code for that field
-
unexpectedBindingResult
-