Include tests for getOne and getBy. Refactor getOne to use getBy logic.