Reload or refresh a Spring application context inside a test method?
By design, programmatic refreshing of an ApplicationContext is not explicitly supported by the Spring TestContext Framework. Furthermore, it is not intended that a test method refresh a context. Thus I would recommend that you reassess your need for a refresh and consider alternatives like placing test methods that require a different set of active profiles … Read more