how to test repository methods in java code example Example: how to use jparepository in unit test @MockBean private YourRepository repository;