0

I have multiple JPA (Hibernate) persisted @OneToMany and @OneToOne relationships in my project that are not held consistent by their setters and adders methods as discussed here. Now I need to refactor these relationships to programmatically keep consistency in place at all times. Do static code analyses / generic unit tests or other tools exist to support me with this task?

Community
  • 1
  • 1
Thorsten
  • 356
  • 4
  • 8

1 Answers1

0

On my project we use integration spring tests with H2(Java SQL database). It allows to find bugs even with relations between entities. There is a SpringRunner for JUnit which load application context so you can test your application almost as real environment. You can find more information here https://docs.spring.io/spring/docs/current/spring-framework-reference/html/integration-testing.html

Mikita Herasiutsin
  • 118
  • 1
  • 2
  • 7