Edit test logic to suitable with the requirement