[Cookbook][Test]fix sample code