unit test covering exception path