added test for lifecycle event of client