TestNG @BeforeTest @BeforeClass. springTestContextPrepareTestInstance() @BeforeClass applicationContext. applicationContext - null @BeforeTest. @BeforeTest wapping . ( @Test, ).
@BeforeTest , , @BeforeClass ( , @Test ). , springTestContextPrepareTestInstance,
@BeforeClass(dependsOnMethods = "springTestContextPrepareTestInstance")
public void registerWebScopes() {
ConfigurableBeanFactory factory = (ConfigurableBeanFactory)
this.applicationContext.getAutowireCapableBeanFactory();
factory.registerScope("session", new SessionScope());
factory.registerScope("request", new RequestScope());
}
@BeforeMethod ( ), @BeforeClass.