Adding test for defect MAGN-2521

There is one more change made for clean up after each test execution. (change made By Ben)