Make DB integration tests cleaner with @Transactional

Adding @Transactional causes the test to run inside a transaction, and rollback on teardown.  Leaves the db in the original state.
Also updated the test to not break with an active login session.

I've also removed the usages of
@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_CLASS)
on the tests to speed things up, and changed the surefire config to
<forkCount>1</forkCount>
<reuseForks>true</reuseForks>
to avoid context reloads.  None of the sample tests actually dirty the context.

I find that loading the context takes ~15s, and that is much too much time to burn on each test class.


On 2014-06-19, at 12:59 PM, Julien Dubois <notifications@github.com<mailto:notifications@github.com>>
 wrote:


In app/templates/src/test/java/package/service/_UserServiceTest.java:

> @@ -16,7 +16,10 @@
>  import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
>  import org.springframework.test.context.web.WebAppConfiguration;
>
> +import ca.intelliware.ihtsdo.mlds.domain.User;


You should use a variable for the package, not your package

—
Reply to this email directly or view it on GitHub<https://github.com/jhipster/generator-jhipster/pull/386/files#r13979852>.