@Inject
private Instance<PersistenceExtensionFeatureResolver> persistenceExtensionFeatureResolver;
public void createSchema(@Observes(precedence = 10) EventContext<BeforePersistenceTest> context)
{
final BeforePersistenceTest beforePersistenceTest = context.getEvent();
if (persistenceExtensionFeatureResolver.get().shouldCreateSchema() && !schemaCreated(beforePersistenceTest))
{
final Collection<SqlScriptResourceDescriptor> schemaDescriptors = SqlScriptProvider.createProviderForCreateSchemaScripts(beforePersistenceTest.getTestClass(), configuration.get()).getDescriptors(beforePersistenceTest.getTestClass());
if (!schemaDescriptors.isEmpty())
{
executeScriptsEvent.fire(new ExecuteScripts(beforePersistenceTest, schemaDescriptors));
}
}