DEV Community

Sebastian Berrio
Sebastian Berrio

Posted on

testing for the repository layer of an entity with multiple relationships

What's up friends, could you help me to solve a doubt, how would be the appropriate way to test the repository layer of an entity that has several @OneToOne relationships?

Is it necessary to inject the dependencies of the repositories corresponding to their relationships and do those operations or is there another mechanism?
Image description

Top comments (1)

Collapse
 
pavelee profile image
Paweł Ciosek

Hey! I am not in the java world, but generally across all stacks we are using mocks for dependencies. Just to isolate code you are testing.