added unit test for service factory