Refactored code in the ResourceFactoryTest and IntegrationBaseTest.