adding unit test for cache mechanism