Implemented helper class to mock Spring Security context minor improvements and refactoring