Rewrite cache generator tests using mocks

This allows us to avoid stubs with hardcoded data placed in the environment, and keeping test data within test method itself looks like a good idea