Package org.dbunit.annotation.runtime
Class AnnotatedTestOptIn
java.lang.Object
org.dbunit.annotation.runtime.AnnotatedTestOptIn
Decides whether a test opts into the
org.dbunit.annotation family, and so into the
annotation-driven lifecycle: any of the annotations that configure a test
(DbUnitConfig, DbUnitPrep, DbUnitSetup, DbUnitExpected,
DbUnitTearDown, DbUnitRowCountCheck) on the test method or class, or a
@DbUnitTester/@DbUnitTestCase field in the test
class or one enclosing it. A plain, unannotated IDatabaseTester field alone
is not an opt-in - that is the 3.5.0 lifecycle-only style, left exactly as it was.
A binding passes its own AnnotationLookup and the test classes in scope, and may
add opt-ins of its own, such as DbUnitExtension's @DbUnitTest. The binding
decides what an opted-out test gets: DbUnitExtension keeps its 3.5.0 lifecycle for
it, while the Spring listener leaves it entirely alone.
Public so a binding outside org.dbunit.annotation.runtime - such as
DbUnitExtension or a Spring TestExecutionListener - can reach it too.
- Since:
- 3.6.0
- Author:
- Jeff Jensen
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisOptedIn(AnnotationLookup lookup, Collection<Class<?>> testClasses) Returns whether the test opts into theorg.dbunit.annotationfamily.
-
Method Details
-
isOptedIn
Returns whether the test opts into theorg.dbunit.annotationfamily.- Parameters:
lookup- Finds the annotations that apply to the test.testClasses- The test class and every class enclosing it whose fields count, for@Nestedsupport.- Returns:
truewhen the test carries an annotation that configures it, or a class in scope declares a@DbUnitTesteror@DbUnitTestCasefield.
-