java - Rollback JUnit Tests in Deltaspike -
i using apache deltaspike openwebbeans cdi in java se project. i've used spring data jpa in java ee project , easy enough setup unit tests didn't commit data database adding @transactional
annotation above class or test methods. however, haven't been able find equivalent technique deltaspike.
apart manually rolling data after each test or deleting , re-creating database each time test run, there way specify each unit test should rollback data changes after completing?
my unit tests following:
@runwith(cditestrunner.class) @transactional // has no effect public class foounittest { @inject private foorepository foorepository; @test @transactional // no effect either public void testfoo() { foo foo = new foo(); foorepository.save(foo); // foo persisted outside test } } @repository public interface foorepository extends entityrepository<foo, integer> { }
Comments
Post a Comment