To get a ResourceResolverFactory.into an AEM service - you inject into your service that functions as the JUNIT test.
@Reference
private
ResourceResolverFactory resolverFactory;'
To learn how to inject a ResourceResolverFactory into an AEM service -- see this community article:
http://helpx.adobe.com/experience-manager/using/querying-experience-manager-data-using1.html
Also -- we will add an article that talks about setting up JUNIT tests with AEM.