Entity tests refactoring