Update unit test and add new essential log and test code