Annotation Type DbUnitSpring
@Target({TYPE,METHOD})
@Retention(RUNTIME)
@Documented
@Inherited
@DirtiesContext(classMode=AFTER_CLASS)
@TestExecutionListeners({org.springframework.test.context.support.DirtiesContextTestExecutionListener.class,org.springframework.test.context.support.DependencyInjectionTestExecutionListener.class,org.springframework.test.context.transaction.TransactionalTestExecutionListener.class,DbUnitTestExecutionListener.class})
public @interface DbUnitSpring
A meta-annotation to automatically integrate Spring with DbUnit.
Following listeners are automatically added to test execution context:
Following listeners are automatically added to test execution context:
-
DirtiesContextTestExecutionListenerto avoid sharing an embedded database (i.e shared resource) between tests that may modify shared state. -
DependencyInjectionTestExecutionListenerto enable dependency injection inside test. -
TransactionalTestExecutionListenerto run unit tests inside transaction. -
DbUnitTestExecutionListenerto enable DbUnit.