use of com.querydsl.jpa.JPATest in project querydsl by querydsl.
the class JPATestRunner method rules.
@Override
protected List<MethodRule> rules(Object test) {
verify(test instanceof JPATest, "In order to use the %s for %s, it should (directly or indirectly) implement %s", JPATestRunner.class.getSimpleName(), test.getClass(), JPATest.class);
List<MethodRule> rules = super.rules(test);
rules.add(new MethodRule() {
@Override
public Statement apply(final Statement base, FrameworkMethod method, final Object target) {
return new Statement() {
@Override
public void evaluate() throws Throwable {
((JPATest) target).setEntityManager(entityManager);
base.evaluate();
}
};
}
});
return rules;
}
Aggregations