how to write unit test for repositories spring boot code example Example: how to use jparepository in unit test @MockBean private YourRepository repository;