private DataSource createRegisterDataSource(ResourceDataSource resourceDataSource) {
   String dataSourceName = resourceDataSource.getName();
   // Makes it possible to define the same datasource in many multiple junit runners
   if (!configBase.hasDataSource(dataSourceName)) {
     DataSource dataSource = configBase.createDataSource(dataSourceName);
     configBase.addResource(dataSourceName, dataSource);
     /* This must be part of the testing "stream" somehow
     configBase.addSQLSchemas(
             resourceDataSource.getPackageName(),
             dataSourceName,
             resourceDataSource.getPath()
     );
     */
     return dataSource;
   }
   return configBase.getDataSource(dataSourceName);
 }
  public InjectionRegistryStream resource(RegisterResourceFunc registerResourceFunc) {
    if (configBase == null) {
      throw new IllegalAccessError("ContainerConfigBase needed for resources");
    }
    InjectionResources registrations = new InjectionResources();
    registerResourceFunc.createResource(registrations);

    for (ResourceEntityManager resourceEntityManager : registrations.getEntityManagers()) {
      String dataSourceName = resourceEntityManager.getResourceDataSource().getName();
      DataSource dataSource =
          createRegisterDataSource(resourceEntityManager.getResourceDataSource());

      String entityManagerName = resourceEntityManager.getName();
      EntityManager entityManager =
          configBase.createEntityManager(entityManagerName, dataSourceName, dataSource);
      configBase.addPersistenceContext(entityManagerName, entityManager);
    }

    for (ResourceDataSource resourceDataSource : registrations.getDataSources()) {
      createRegisterDataSource(resourceDataSource);
    }

    return this;
  }