use of com.querydsl.jpa.HibernateTest in project querydsl by querydsl.
the class HibernateTestRunner method rules.
@Override
protected List<MethodRule> rules(Object test) {
verify(test instanceof HibernateTest, "In order to use the %s for %s, it should (directly or indirectly) implement %s", HibernateTestRunner.class.getSimpleName(), test.getClass(), HibernateTest.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 {
((HibernateTest) target).setSession(session);
base.evaluate();
}
};
}
});
return rules;
}
Aggregations