runCommand method with UT