test: use mock to test expected behavior