Refactoring to tests Components with the same method, retrieves the service object