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:
  • DirtiesContextTestExecutionListener to avoid sharing an embedded database (i.e shared resource) between tests that may modify shared state.
  • DependencyInjectionTestExecutionListener to enable dependency injection inside test.
  • TransactionalTestExecutionListener to run unit tests inside transaction.
  • DbUnitTestExecutionListener to enable DbUnit.