MULE-6843: Adding test case for client factory plus its corresponding fixes