Package org.assertj.core.internal
Class Classes
- java.lang.Object
-
- org.assertj.core.internal.Classes
-
-
Constructor Summary
Constructors Constructor Description Classes()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidassertContainsAnnotations(AssertionInfo info, Class<?> actual, Class<? extends Annotation>... annotations)Verifies that the actualClasscontains the givenAnnotations.voidassertHasDeclaredFields(AssertionInfo info, Class<?> actual, String... fields)Verifies that the actualClasshas the declaredfields.voidassertHasDeclaredMethods(AssertionInfo info, Class<?> actual, String... methods)Verifies that the actualClasshas the declaredmethods.voidassertHasMethods(AssertionInfo info, Class<?> actual, String... methods)Verifies that the actualClasshas themethods.voidassertHasOnlyDeclaredFields(AssertionInfo info, Class<?> actual, String... expectedFields)Verifies that the actualClasshas the exactly thefieldsand nothing more.voidassertHasOnlyPublicFields(AssertionInfo info, Class<?> actual, String... expectedFields)Verifies that the actualClasshas only thefieldsand nothing more.voidassertHasPublicFields(AssertionInfo info, Class<?> actual, String... fields)Verifies that the actualClasshas thefields.voidassertHasPublicMethods(AssertionInfo info, Class<?> actual, String... methods)Verifies that the actualClasshas the publicmethods.voidassertIsAnnotation(AssertionInfo info, Class<?> actual)Verifies that the actualClassis an annotation.voidassertIsAssignableFrom(AssertionInfo info, Class<?> actual, Class<?>... others)Verifies that the actualClassis assignable from all theothersclasses.voidassertIsFinal(AssertionInfo info, Class<?> actual)Verifies that the actualClassis final.voidassertIsInterface(AssertionInfo info, Class<?> actual)Verifies that the actualClassis an interface.voidassertIsNotAnnotation(AssertionInfo info, Class<?> actual)Verifies that the actualClassis not an annotation.voidassertIsNotFinal(AssertionInfo info, Class<?> actual)Verifies that the actualClassis not final.voidassertIsNotInterface(AssertionInfo info, Class<?> actual)Verifies that the actualClassis not an interface.voidassertIsProtected(AssertionInfo info, Class<?> actual)Verifies that the actualClassis protected.voidassertIsPublic(AssertionInfo info, Class<?> actual)Verifies that the actualClassis public.static Classesinstance()Returns the singleton instance of this class.
-
-
-
Method Detail
-
instance
public static Classes instance()
Returns the singleton instance of this class.- Returns:
- the singleton instance of this class.
-
assertIsAssignableFrom
public void assertIsAssignableFrom(AssertionInfo info, Class<?> actual, Class<?>... others)
Verifies that the actualClassis assignable from all theothersclasses.- Parameters:
info- contains information about the assertion.actual- the "actual"Class.others- the othersClasswho this actual class must be assignable.- Throws:
NullPointerException- if one of theothersisnull.AssertionError- ifactualisnull.AssertionError- if the actualClassis not assignable from all of theothersclasses.
-
assertIsNotInterface
public void assertIsNotInterface(AssertionInfo info, Class<?> actual)
Verifies that the actualClassis not an interface.- Parameters:
info- contains information about the assertion.actual- the "actual"Class.- Throws:
AssertionError- ifactualisnull.AssertionError- if the actualClassis an interface.
-
assertIsInterface
public void assertIsInterface(AssertionInfo info, Class<?> actual)
Verifies that the actualClassis an interface.- Parameters:
info- contains information about the assertion.actual- the "actual"Class.- Throws:
AssertionError- ifactualisnull.AssertionError- if the actualClassis not an interface.
-
assertIsNotAnnotation
public void assertIsNotAnnotation(AssertionInfo info, Class<?> actual)
Verifies that the actualClassis not an annotation.- Parameters:
info- contains information about the assertion.actual- the "actual"Class.- Throws:
AssertionError- ifactualisnull.AssertionError- if the actualClassis an annotation.
-
assertIsAnnotation
public void assertIsAnnotation(AssertionInfo info, Class<?> actual)
Verifies that the actualClassis an annotation.- Parameters:
info- contains information about the assertion.actual- the "actual"Class.- Throws:
AssertionError- ifactualisnull.AssertionError- if the actualClassis not an annotation.
-
assertIsFinal
public void assertIsFinal(AssertionInfo info, Class<?> actual)
Verifies that the actualClassis final.- Parameters:
info- contains information about the assertion.actual- the "actual"Class.- Throws:
AssertionError- ifactualisnull.AssertionError- if the actualClassis not final.
-
assertIsPublic
public void assertIsPublic(AssertionInfo info, Class<?> actual)
Verifies that the actualClassis public.- Parameters:
info- contains information about the assertion.actual- the "actual"Class.- Throws:
AssertionError- ifactualisnull.AssertionError- if the actualClassis not public.
-
assertIsProtected
public void assertIsProtected(AssertionInfo info, Class<?> actual)
Verifies that the actualClassis protected.- Parameters:
info- contains information about the assertion.actual- the "actual"Class.- Throws:
AssertionError- ifactualisnull.AssertionError- if the actualClassis not protected.
-
assertIsNotFinal
public void assertIsNotFinal(AssertionInfo info, Class<?> actual)
Verifies that the actualClassis not final.- Parameters:
info- contains information about the assertion.actual- the "actual"Class.- Throws:
AssertionError- ifactualisnull.AssertionError- if the actualClassis final.
-
assertContainsAnnotations
public void assertContainsAnnotations(AssertionInfo info, Class<?> actual, Class<? extends Annotation>... annotations)
Verifies that the actualClasscontains the givenAnnotations.- Parameters:
info- contains information about the assertion.actual- the "actual"Class.annotations- annotations who must be attached to the class- Throws:
AssertionError- ifactualisnull.AssertionError- if the actualClassdoesn't contains all of these annotations.
-
assertHasPublicFields
public void assertHasPublicFields(AssertionInfo info, Class<?> actual, String... fields)
Verifies that the actualClasshas thefields.- Parameters:
info- contains information about the assertion.actual- the "actual"Class.fields- the fields who must be present in the class.- Throws:
AssertionError- ifactualisnull.AssertionError- if the actualClassdoesn't contains all of the field.
-
assertHasOnlyPublicFields
public void assertHasOnlyPublicFields(AssertionInfo info, Class<?> actual, String... expectedFields)
Verifies that the actualClasshas only thefieldsand nothing more. in any order.- Parameters:
info- contains information about the assertion.actual- the "actual"Class.expectedFields- all the fields that are expected to be in the class.- Throws:
AssertionError- ifactualisnull.AssertionError- if fields are not all the fields of the actualClass.
-
assertHasDeclaredFields
public void assertHasDeclaredFields(AssertionInfo info, Class<?> actual, String... fields)
Verifies that the actualClasshas the declaredfields.- Parameters:
info- contains information about the assertion.actual- the "actual"Class.fields- the fields who must be declared in the class.- Throws:
AssertionError- ifactualisnull.AssertionError- if the actualClassdoesn't contains all of the field.
-
assertHasOnlyDeclaredFields
public void assertHasOnlyDeclaredFields(AssertionInfo info, Class<?> actual, String... expectedFields)
Verifies that the actualClasshas the exactly thefieldsand nothing more. in any order.- Parameters:
info- contains information about the assertion.actual- the "actual"Class.expectedFields- all the fields that are expected to be in the class.- Throws:
AssertionError- ifactualisnull.AssertionError- if fields are not all the fields of the actualClass.
-
assertHasMethods
public void assertHasMethods(AssertionInfo info, Class<?> actual, String... methods)
Verifies that the actualClasshas themethods.- Parameters:
info- contains information about the assertion.actual- the "actual"Class.methods- the methods who must be present in the class.- Throws:
AssertionError- ifactualisnull.AssertionError- if the actualClassdoesn't contains all of the methods.
-
assertHasDeclaredMethods
public void assertHasDeclaredMethods(AssertionInfo info, Class<?> actual, String... methods)
Verifies that the actualClasshas the declaredmethods.- Parameters:
info- contains information about the assertion.actual- the "actual"Class.methods- the methods who must be declared in the class.- Throws:
AssertionError- ifactualisnull.AssertionError- if the actualClassdoesn't contains all of the methods.
-
assertHasPublicMethods
public void assertHasPublicMethods(AssertionInfo info, Class<?> actual, String... methods)
Verifies that the actualClasshas the publicmethods.- Parameters:
info- contains information about the assertion.actual- the "actual"Class.methods- the public methods who must be present in the class.- Throws:
AssertionError- ifactualisnull.AssertionError- if the actualClassdoesn't contains all of the public methods.
-
-