updated mock and added a test for it