Package org.assertj.reflection
Class MethodAssert
java.lang.Object
org.assertj.core.api.AbstractAssert<MethodAssert,Method>
org.assertj.reflection.MethodAssert
- All Implemented Interfaces:
org.assertj.core.api.Assert<MethodAssert,
,Method> org.assertj.core.api.Descriptable<MethodAssert>
,org.assertj.core.api.ExtensionPoints<MethodAssert,
Method>
Assertions for the
Method
type.-
Field Summary
Fields inherited from class org.assertj.core.api.AbstractAssert
actual, info, myself, objects, throwUnsupportedExceptionOnEquals
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionhasReturnType
(Class<?> expected) Verifies that theMethod
has the expected return type.Verifies that theMethod
is not package-private.Verifies that theMethod
is not private.Verifies that theMethod
is not protected.Verifies that theMethod
is not public.Verifies that theMethod
is not static.Verifies that theMethod
is package-private.Verifies that theMethod
is private.Verifies that theMethod
is protected.isPublic()
Verifies that theMethod
is public.isStatic()
Verifies that theMethod
is static.throwsException
(Class<? extends Exception> expected) Verifies that theMethod
declares the given exception to be thrown.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, 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
-
Constructor Details
-
MethodAssert
Creates a newMethodAssert
.- Parameters:
actual
- The actual value.
-
-
Method Details
-
isPublic
Verifies that theMethod
is public.- Returns:
- This
MethodAssert
instance.
-
isNotPublic
Verifies that theMethod
is not public.- Returns:
- This
MethodAssert
instance.
-
isProtected
Verifies that theMethod
is protected.- Returns:
- This
MethodAssert
instance.
-
isNotProtected
Verifies that theMethod
is not protected.- Returns:
- This
MethodAssert
instance.
-
isPrivate
Verifies that theMethod
is private.- Returns:
- This
MethodAssert
instance.
-
isNotPrivate
Verifies that theMethod
is not private.- Returns:
- This
MethodAssert
instance.
-
isPackagePrivate
Verifies that theMethod
is package-private.- Returns:
- This
MethodAssert
instance.
-
isNotPackagePrivate
Verifies that theMethod
is not package-private.- Returns:
- This
MethodAssert
instance.
-
isStatic
Verifies that theMethod
is static.- Returns:
- This
MethodAssert
instance.
-
isNotStatic
Verifies that theMethod
is not static.- Returns:
- This
MethodAssert
instance.
-
hasReturnType
Verifies that theMethod
has the expected return type.- Parameters:
expected
- The expected return type of theMethod
.- Returns:
- This
MethodAssert
instance.
-
throwsException
Verifies that theMethod
declares the given exception to be thrown. If a declared exception is assignable to the expected exception, this assertion passes.- Parameters:
expected
- The expected exception to be thrown.- Returns:
- This
MethodAssert
instance.
-