0

I have a new jhipster project and want to create a bunch of testdata to fill into production database to have the possibilitay to show my application with some data.

Can you give me a best practice? I have added a junittest which is run against prod profile. Is this OK?

I furthermore have the problem, that the data can be read from database in the testcase after creating, but it seems to be not in the database although I have added @Transactional (like the UserServiceTest created by jhipster).

Can you give me a hint what's the problem or how I can increase loglevel for transaction things?

Thanks in advance Best regards Markus

Markus Oley
  • 91
  • 1
  • 9

1 Answers1

0

I have found the reason, why this behaviour is so in post http://forum.spring.io/forum/spring-projects/data/53804-commit-transactions-running-springjunit4classrunner.

I am using SpringJUnit4ClassRunner, which rolls back it's transactions at the end. If you want to disable this behaviour you have to add a @TransactionConfiguration(defaultRollback = false) to your test class or a @Rollback(false) to your test method.

Cheers Markus

Markus Oley
  • 91
  • 1
  • 9