how to test controller that uses jpa repository code example Example: how to use jparepository in unit test @MockBean private YourRepository repository;