use of core.framework.test.module.AbstractTestModule in project core-ng-project by neowu.
the class IntegrationExtension method createTestBeanFactory.
private TestBeanFactory createTestBeanFactory(Class<?> testClass, ExtensionContext.Store store) {
Boolean initialized = store.get(KEY_INITIALIZED, Boolean.class);
if (Boolean.TRUE.equals(initialized))
throw new Error("test context failed to initialize, please check error message from previous integration test");
store.put(KEY_INITIALIZED, true);
Context context = findContext(testClass);
TestBeanFactory beanFactory = new TestBeanFactory();
try {
AbstractTestModule module = context.module().getConstructor().newInstance();
module.configure(beanFactory);
} catch (ReflectiveOperationException e) {
throw new Error("failed to create test context", e);
}
return beanFactory;
}
Aggregations