Currently CDI module has it's own annotation @UsingDataSet which is a copy of @DataSet but with @InterceptorBinding to activate DBUnitInterceptor.
Remove @UsingDataSet in favor of @DataSet annotation.
DBUnitInterceptor should be activated by @DBUnitInterceptor annotation, ex:
@RunWith(CdiTestRunner.class)
@DBUnitInterceptor
public class CrudCDIIt {
@Inject
EntityManager em;
@Test
@DataSet("users.yml")
public void shouldListUsers() {
List<User> users = em.createQuery("select u from User u").getResultList();
assertThat(users).isNotNull().isNotEmpty().hasSize(2);
}
}
Currently CDI module has it's own annotation @UsingDataSet which is a copy of @DataSet but with @InterceptorBinding to activate DBUnitInterceptor.
Remove @UsingDataSet in favor of @DataSet annotation.
DBUnitInterceptor should be activated by @DBUnitInterceptor annotation, ex: