Fixes failing tests in ResourceFactoryProviderSpec and AuthenticationServiceSpec