MULE-6843: unit tests for OAuth2Manager and its corresponding fixes and code cleanups