All Downloads are FREE. Search and download functionalities are using the official Maven repository.

eu.drus.jpa.unit.rule.MethodRuleRegistrar Maven / Gradle / Ivy

Go to download

JUnit 4 extension to run tests for JPA entities using EntityManagerFactory or EntityManager

There is a newer version: 0.5.0
Show newest version
package eu.drus.jpa.unit.rule;

import java.util.List;

import org.junit.rules.MethodRule;

import eu.drus.jpa.unit.spi.ExecutionContext;
import eu.drus.jpa.unit.spi.DecoratorExecutor;

public final class MethodRuleRegistrar {

    private MethodRuleRegistrar() {}

    public static List registerRules(final List rules, final DecoratorExecutor executor, final ExecutionContext ctx) {
        rules.add((base, method, target) -> new TestMethodStatement(ctx, executor, base, method, target));
        rules.add((base, method, target) -> new TestClassStatement(ctx, executor, base, target));
        return rules;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy