Improve test for case when resource is not found