Refactor resource-set-cache and resource-set-cache-test to use when 3.x apis