refactored and completed resource history test and service invoker test