We can extend CrudRepository to expose all create, read, update, and delete methods on an entity. The following snippet shows TodoRepository extending CrudRepository:
public interface TodoRepository extends CrudRepository<Todo, Long>
{
}
TodoRepository can be used to perform all methods exposed by the CrudRepository interface. Let's write a few unit tests to test some of these methods.