how to test custom query in springboot junit code example Example: how to use jparepository in unit test @MockBean private YourRepository repository;