Fix tests

- try to close connection in afterMethod for JPA test
- fix functional test setup