Improve unit tests in RepositoryServiceTest