@Override
    public ContextCustomizer createContextCustomizer(Class<?> testClass, List<ContextConfigurationAttributes> configAttributes) {
        Set<AutoConfigureEmbeddedDatabase> annotations = AnnotationUtils.getDatabaseAnnotations(testClass);

        if (!annotations.isEmpty()) {
            Set<DatabaseDefinition> definitions = annotations.stream()
                    .filter(annotation -> annotation.replace() != Replace.NONE)
                    .map(a -> new DatabaseDefinition(a.beanName(), a.type(), a.provider()))
                    .collect(toCollection(LinkedHashSet::new));

            return new EmbeddedDatabaseContextCustomizer(definitions);
        }

        return null;
    }
Implementation of the {@link org.springframework.test.context.ContextCustomizerFactory} interface,
which is responsible for initialization of the embedded database and its registration to the application context.
The applied initialization strategy is driven by the {@link AutoConfigureEmbeddedDatabase} annotation.

@see AutoConfigureEmbeddedDatabase
embedded-database-spring-test/src/main/java/io/zonky/test/db/EmbeddedDatabaseContextCustomizerFactory.java