Fix entity rule service
Rewrite entity base test