PIM-1325 : refactor unit test and entity manager mock
PIM-1325 : add abstract unit test