Updated the test class for removing the bean definition