Hi Thomas,

I'm using database rider (https://github.com/database-rider/database-rider)
with DS CdiTestRunner. Something like this:



*@RunWith(CdiTestRunner.class)@DBUnitInterceptor*
public class ConfigurationRepositoryTest
{

   * @Inject*
    private ConfigurationRepository configurationRepository;

    *@Test*
   * @DataSet(value = "yml/configuration-repository-base.yml")*
    public void configurationFindAll()
    {
        assertNotNull(configurationRepository);
        assertThat(configurationRepository.findAll(), hasSize(2));
    }

...

I run against an H2 database.
For the service layer I prefer to use Mockito test runner.

Regards,
LA





On Sat, Mar 24, 2018 at 11:26 AM, Gerhard Petracek <[email protected]>
wrote:

> hi tom,
>
> just create junit/cdi-tests with the help of [1].
>
> regards,
> gerhard
>
> [1] http://deltaspike.apache.org/documentation/test-control.html
>
>
>
> 2018-03-24 11:58 GMT+01:00 Thomas Lustig <[email protected]>:
>
> > Dear community,
> >
> > I really like using the Deltaspikes Datamodule with its Repositories.
> > To improve in productivity and lower the Errors i am also writing
> Unittests
> > via JUnit.
> > Before i used DBUnit with Plain JPA/Hibernate inside the testcases, but i
> > would like
> > to test my deltaspike JPA repositories via JUnit - or maybe enhanced with
> > DBUnit.
> > Are there any best practises or ways how to do this?
> > I found some integration project that combines dbunit with Deltaspike,
> but
> > i was not able to getit running with Hibernate JPA Provider.
> >
> > https://github.com/lbitonti/deltaspike-dbunit
> >
> > Thanking you very much in advance for any help
> >
> > Br Tom
> >
>

Reply via email to