Package org.assertj.reflection
Class ClassAssert
java.lang.Object
org.assertj.core.api.AbstractAssert<ClassAssert,Class<?>>
org.assertj.reflection.ClassAssert
- All Implemented Interfaces:
org.assertj.core.api.Assert<ClassAssert,,Class<?>> org.assertj.core.api.Descriptable<ClassAssert>,org.assertj.core.api.ExtensionPoints<ClassAssert,Class<?>>
Assertions for the
Class type.-
Field Summary
Fields inherited from class org.assertj.core.api.AbstractAssert
actual, info, myself, objects, throwUnsupportedExceptionOnEquals -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionhasDeclaredConstructor(Class<?>... parameterTypes) Verifies that theClasshas a declared constructor with the given argument types.hasDeclaredConstructor(Class<?>[] parameterTypes, java.util.function.Consumer<ConstructorAssert> constructorAssertConsumer) Verifies that theClasshas a declared constructor with multiple arguments.hasDeclaredConstructor(Class<?> parameterType, java.util.function.Consumer<ConstructorAssert> constructorAssertConsumer) Verifies that theClasshas a declared constructor with a single argument.hasDeclaredConstructor(java.util.function.Consumer<ConstructorAssert> constructorAssertConsumer) Verifies that theClasshas a declared constructor with no arguments.hasDeclaredField(String fieldName) Verifies that theClasshas a declared field with the given name.hasDeclaredField(String fieldName, java.util.function.Consumer<FieldAssert> fieldAssertConsumer) Verifies that theClasshas a declared field with the given name.hasDeclaredMethod(String methodName, Class<?>... parameterTypes) Verifies that theClasshas a declared method with the given name and argument types.hasDeclaredMethod(String methodName, Class<?>[] parameterTypes, java.util.function.Consumer<MethodAssert> methodAssertConsumer) Verifies that theClasshas a declared method with the given name and multiple arguments.hasDeclaredMethod(String methodName, Class<?> parameterType, java.util.function.Consumer<MethodAssert> methodAssertConsumer) Verifies that theClasshas a declared method with the given name and a single argument.hasDeclaredMethod(String methodName, java.util.function.Consumer<MethodAssert> methodAssertConsumer) Verifies that theClasshas a declared method with the given name and no arguments.hasNoDeclaredConstructor(Class<?>... parameterTypes) Verifies that theClassdoes not have a declared constructor with the given argument types.hasNoDeclaredField(String fieldName) Verifies that theClassdoes not have a declared field with the given name.hasNoDeclaredMethod(String methodName, Class<?>... parameterTypes) Verifies that theClasshas a declared method with the given name and argument types.Methods inherited from class org.assertj.core.api.AbstractAssert
asInstanceOf, asList, assertionError, asString, describedAs, descriptionText, doesNotHave, doesNotHaveSameClassAs, doesNotHaveSameHashCodeAs, doesNotHaveToString, equals, extracting, extracting, failure, failureWithActualExpected, failWithActualExpectedAndMessage, failWithMessage, getWritableAssertionInfo, has, hashCode, hasSameClassAs, hasSameHashCodeAs, 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, satisfiesAnyOf, satisfiesAnyOf, satisfiesAnyOf, setCustomRepresentation, setDescriptionConsumer, setPrintAssertionsDescription, throwAssertionError, usingComparator, usingComparator, usingDefaultComparator, usingRecursiveComparison, usingRecursiveComparison, withFailMessage, withFailMessage, withRepresentation, withThreadDumpOnErrorMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.assertj.core.api.Descriptable
as, as, as, describedAs
-
Constructor Details
-
ClassAssert
Creates a newClassAssert.- Parameters:
actual- The actual value.
-
-
Method Details
-
hasDeclaredConstructor
Verifies that theClasshas a declared constructor with the given argument types.- Parameters:
parameterTypes- The types of the constructor arguments.- Returns:
- this
ClassAssertinstance.
-
hasDeclaredConstructor
public ClassAssert hasDeclaredConstructor(java.util.function.Consumer<ConstructorAssert> constructorAssertConsumer) Verifies that theClasshas a declared constructor with no arguments.- Parameters:
constructorAssertConsumer- Consumer that is invoked with an instance ofConstructorAssert, to perform additional assertions on the matched constructor.- Returns:
- this
ClassAssertinstance.
-
hasDeclaredConstructor
public ClassAssert hasDeclaredConstructor(Class<?> parameterType, java.util.function.Consumer<ConstructorAssert> constructorAssertConsumer) Verifies that theClasshas a declared constructor with a single argument.- Parameters:
parameterType- The type of the constructor argument.constructorAssertConsumer- Consumer that is invoked with an instance ofConstructorAssert, to perform additional assertions on the matched constructor.- Returns:
- this
ClassAssertinstance.
-
hasDeclaredConstructor
public ClassAssert hasDeclaredConstructor(Class<?>[] parameterTypes, java.util.function.Consumer<ConstructorAssert> constructorAssertConsumer) Verifies that theClasshas a declared constructor with multiple arguments.- Parameters:
parameterTypes- The types of the constructor arguments.constructorAssertConsumer- Consumer that is invoked with an instance ofConstructorAssert, to perform additional assertions on the matched constructor.- Returns:
- this
ClassAssertinstance.
-
hasNoDeclaredConstructor
Verifies that theClassdoes not have a declared constructor with the given argument types.- Parameters:
parameterTypes- The types of the constructor arguments.- Returns:
- this
ClassAssertinstance.
-
hasDeclaredField
Verifies that theClasshas a declared field with the given name.- Parameters:
fieldName- The name of the declared field.- Returns:
- this
ClassAssertinstance.
-
hasDeclaredField
public ClassAssert hasDeclaredField(String fieldName, java.util.function.Consumer<FieldAssert> fieldAssertConsumer) Verifies that theClasshas a declared field with the given name.- Parameters:
fieldName- The name of the declared field.fieldAssertConsumer- Consumer that is invoked with an instance ofFieldAssert, to perform additional assertions on the matched field.- Returns:
- this
ClassAssertinstance.
-
hasNoDeclaredField
Verifies that theClassdoes not have a declared field with the given name.- Parameters:
fieldName- The name of the declared field.- Returns:
- this
ClassAssertinstance.
-
hasDeclaredMethod
Verifies that theClasshas a declared method with the given name and argument types.- Parameters:
methodName- The name of the declared method.parameterTypes- The types of the declared method arguments.- Returns:
- this
ClassAssertinstance.
-
hasDeclaredMethod
public ClassAssert hasDeclaredMethod(String methodName, java.util.function.Consumer<MethodAssert> methodAssertConsumer) Verifies that theClasshas a declared method with the given name and no arguments.- Parameters:
methodName- The name of the declared method.methodAssertConsumer- Consumer that is invoked with an instance ofMethodAssert, to perform additional assertions on the matched method.- Returns:
- this
ClassAssertinstance.
-
hasDeclaredMethod
public ClassAssert hasDeclaredMethod(String methodName, Class<?> parameterType, java.util.function.Consumer<MethodAssert> methodAssertConsumer) Verifies that theClasshas a declared method with the given name and a single argument.- Parameters:
methodName- The name of the declared method.parameterType- The type of the declared method argument.methodAssertConsumer- Consumer that is invoked with an instance ofMethodAssert, to perform additional assertions on the matched method.- Returns:
- this
ClassAssertinstance.
-
hasDeclaredMethod
public ClassAssert hasDeclaredMethod(String methodName, Class<?>[] parameterTypes, java.util.function.Consumer<MethodAssert> methodAssertConsumer) Verifies that theClasshas a declared method with the given name and multiple arguments.- Parameters:
methodName- The name of the declared method.parameterTypes- The types of the declared method arguments.methodAssertConsumer- Consumer that is invoked with an instance ofMethodAssert, to perform additional assertions on the matched method.- Returns:
- this
ClassAssertinstance.
-
hasNoDeclaredMethod
Verifies that theClasshas a declared method with the given name and argument types.- Parameters:
methodName- The name of the declared method.parameterTypes- The types of the declared method arguments.- Returns:
- this
ClassAssertinstance.
-