| Constructor and Description |
|---|
Classes() |
| Modifier and Type | Method and Description |
|---|---|
void |
assertContainsAnnotations(AssertionInfo info,
Class<?> actual,
Class<? extends Annotation>... annotations)
Verifies that the actual
Class contains the given Annotations. |
void |
assertHasDeclaredFields(AssertionInfo info,
Class<?> actual,
String... fields)
Verifies that the actual
Class has the declared fields. |
void |
assertHasDeclaredMethods(AssertionInfo info,
Class<?> actual,
String... methods)
Verifies that the actual
Class has the declared methods. |
void |
assertHasMethods(AssertionInfo info,
Class<?> actual,
String... methods)
Verifies that the actual
Class has the methods. |
void |
assertHasOnlyDeclaredFields(AssertionInfo info,
Class<?> actual,
String... expectedFields)
Verifies that the actual
Class has the exactly the fields and nothing more. |
void |
assertHasOnlyPublicFields(AssertionInfo info,
Class<?> actual,
String... expectedFields)
Verifies that the actual
Class has only the fields and nothing more. |
void |
assertHasPublicFields(AssertionInfo info,
Class<?> actual,
String... fields)
Verifies that the actual
Class has the fields. |
void |
assertHasPublicMethods(AssertionInfo info,
Class<?> actual,
String... methods)
Verifies that the actual
Class has the public methods. |
void |
assertIsAbstract(AssertionInfo info,
Class<?> actual)
Verifies that the actual
Class is abstract. |
void |
assertIsAnnotation(AssertionInfo info,
Class<?> actual)
Verifies that the actual
Class is an annotation. |
void |
assertIsAssignableFrom(AssertionInfo info,
Class<?> actual,
Class<?>... others)
Verifies that the actual
Class is assignable from all the others classes. |
void |
assertIsFinal(AssertionInfo info,
Class<?> actual)
Verifies that the actual
Class is final. |
void |
assertIsInterface(AssertionInfo info,
Class<?> actual)
Verifies that the actual
Class is an interface. |
void |
assertIsNotAnnotation(AssertionInfo info,
Class<?> actual)
Verifies that the actual
Class is not an annotation. |
void |
assertIsNotFinal(AssertionInfo info,
Class<?> actual)
Verifies that the actual
Class is not final. |
void |
assertIsNotInterface(AssertionInfo info,
Class<?> actual)
Verifies that the actual
Class is not an interface. |
void |
assertIsProtected(AssertionInfo info,
Class<?> actual)
Verifies that the actual
Class is protected. |
void |
assertIsPublic(AssertionInfo info,
Class<?> actual)
Verifies that the actual
Class is public. |
static Classes |
instance()
Returns the singleton instance of this class.
|
public static Classes instance()
public void assertIsAssignableFrom(AssertionInfo info, Class<?> actual, Class<?>... others)
Class is assignable from all the others classes.info - contains information about the assertion.actual - the "actual" Class.others - the others Class who this actual class must be assignable.NullPointerException - if one of the others is null.AssertionError - if actual is null.AssertionError - if the actual Class is not assignable from all of the others classes.public void assertIsNotInterface(AssertionInfo info, Class<?> actual)
Class is not an interface.info - contains information about the assertion.actual - the "actual" Class.AssertionError - if actual is null.AssertionError - if the actual Class is an interface.public void assertIsInterface(AssertionInfo info, Class<?> actual)
Class is an interface.info - contains information about the assertion.actual - the "actual" Class.AssertionError - if actual is null.AssertionError - if the actual Class is not an interface.public void assertIsAbstract(AssertionInfo info, Class<?> actual)
Class is abstract.info - contains information about the assertion.actual - the "actual" Class.AssertionError - if actual is null.AssertionError - if the actual Class is not abstract.public void assertIsNotAnnotation(AssertionInfo info, Class<?> actual)
Class is not an annotation.info - contains information about the assertion.actual - the "actual" Class.AssertionError - if actual is null.AssertionError - if the actual Class is an annotation.public void assertIsAnnotation(AssertionInfo info, Class<?> actual)
Class is an annotation.info - contains information about the assertion.actual - the "actual" Class.AssertionError - if actual is null.AssertionError - if the actual Class is not an annotation.public void assertIsFinal(AssertionInfo info, Class<?> actual)
Class is final.info - contains information about the assertion.actual - the "actual" Class.AssertionError - if actual is null.AssertionError - if the actual Class is not final.public void assertIsPublic(AssertionInfo info, Class<?> actual)
Class is public.info - contains information about the assertion.actual - the "actual" Class.AssertionError - if actual is null.AssertionError - if the actual Class is not public.public void assertIsProtected(AssertionInfo info, Class<?> actual)
Class is protected.info - contains information about the assertion.actual - the "actual" Class.AssertionError - if actual is null.AssertionError - if the actual Class is not protected.public void assertIsNotFinal(AssertionInfo info, Class<?> actual)
Class is not final.info - contains information about the assertion.actual - the "actual" Class.AssertionError - if actual is null.AssertionError - if the actual Class is final.public void assertContainsAnnotations(AssertionInfo info, Class<?> actual, Class<? extends Annotation>... annotations)
Class contains the given Annotations.info - contains information about the assertion.actual - the "actual" Class.annotations - annotations who must be attached to the classAssertionError - if actual is null.AssertionError - if the actual Class doesn't contains all of these annotations.public void assertHasPublicFields(AssertionInfo info, Class<?> actual, String... fields)
Class has the fields.info - contains information about the assertion.actual - the "actual" Class.fields - the fields who must be present in the class.AssertionError - if actual is null.AssertionError - if the actual Class doesn't contains all of the field.public void assertHasOnlyPublicFields(AssertionInfo info, Class<?> actual, String... expectedFields)
Class has only the fields and nothing more. in any order.info - contains information about the assertion.actual - the "actual" Class.expectedFields - all the fields that are expected to be in the class.AssertionError - if actual is null.AssertionError - if fields are not all the fields of the actual Class.public void assertHasDeclaredFields(AssertionInfo info, Class<?> actual, String... fields)
Class has the declared fields.info - contains information about the assertion.actual - the "actual" Class.fields - the fields who must be declared in the class.AssertionError - if actual is null.AssertionError - if the actual Class doesn't contains all of the field.public void assertHasOnlyDeclaredFields(AssertionInfo info, Class<?> actual, String... expectedFields)
Class has the exactly the fields and nothing more. in any order.info - contains information about the assertion.actual - the "actual" Class.expectedFields - all the fields that are expected to be in the class.AssertionError - if actual is null.AssertionError - if fields are not all the fields of the actual Class.public void assertHasMethods(AssertionInfo info, Class<?> actual, String... methods)
Class has the methods.info - contains information about the assertion.actual - the "actual" Class.methods - the methods who must be present in the class.AssertionError - if actual is null.AssertionError - if the actual Class doesn't contains all of the methods.public void assertHasDeclaredMethods(AssertionInfo info, Class<?> actual, String... methods)
Class has the declared methods.info - contains information about the assertion.actual - the "actual" Class.methods - the methods who must be declared in the class.AssertionError - if actual is null.AssertionError - if the actual Class doesn't contains all of the methods.public void assertHasPublicMethods(AssertionInfo info, Class<?> actual, String... methods)
Class has the public methods.info - contains information about the assertion.actual - the "actual" Class.methods - the public methods who must be present in the class.AssertionError - if actual is null.AssertionError - if the actual Class doesn't contains all of the public methods.Copyright © 2014–2019 AssertJ. All rights reserved.