added integrity checks in TestEntityService