Refactored and removed unnecessary lines in the test case
Merge pull request #9596 from choudhuryanupam/master

Refactored the code to remove irrelevant lines