@Test void testOnApplicationEvent() { ContextRefreshedEvent event = mock(ContextRefreshedEvent.class); ApplicationContext applicationContext = mock(ApplicationContext.class); when(event.getApplicationContext()).thenReturn(applicationContext); bootstrapper.bootstrap(event); verify(bootstrappingEventPublisher).publishBootstrappingStartedEvent(); verify(upgradeBootstrapper).bootstrap(); verify(dataSourceAclTablesPopulator).populate(); verify(transactionExceptionTranslatorRegistrar).register(applicationContext); verify(registryBootstrapper).bootstrap(event); verify(systemEntityTypeBootstrapper).bootstrap(event); verify(repositoryPopulator).populate(event); verify(systemPermissionPopulator).populate(applicationContext); verify(jobBootstrapper).bootstrap(); verify(importBootstrapper).bootstrap(); verify(indexBootstrapper).bootstrap(); verify(entityTypeRegistryPopulator).populate(); verify(bootstrapThemePopulator).populate(); verify(bootstrappingEventPublisher).publishBootstrappingFinishedEvent(); }
@Transactional @RunAsSystem public void bootstrap(ContextRefreshedEvent event) { LOG.info("Bootstrapping application ..."); bootstrappingEventPublisher.publishBootstrappingStartedEvent(); LOG.trace("Updating MOLGENIS ..."); upgradeBootstrapper.bootstrap(); LOG.debug("Updated MOLGENIS"); LOG.trace("Populating data source with ACL tables ..."); dataSourceAclTablesPopulator.populate(); LOG.debug("Populated data source with ACL tables"); LOG.trace("Bootstrapping transaction exception translators ..."); transactionExceptionTranslatorRegistrar.register(event.getApplicationContext()); LOG.debug("Bootstrapped transaction exception translators"); LOG.trace("Bootstrapping registries ..."); registryBootstrapper.bootstrap(event); LOG.debug("Bootstrapped registries"); LOG.trace("Bootstrapping system entity meta data ..."); systemEntityTypeBootstrapper.bootstrap(event); LOG.debug("Bootstrapped system entity meta data"); LOG.trace("Populating repositories ..."); repositoryPopulator.populate(event); LOG.debug("Populated repositories"); LOG.trace("Populating permissions ..."); systemPermissionPopulator.populate(event.getApplicationContext()); LOG.debug("Populated permissions"); LOG.trace("Bootstrapping jobs ..."); jobBootstrapper.bootstrap(); LOG.debug("Bootstrapped jobs"); LOG.trace("Bootstrapping import ..."); importBootstrapper.bootstrap(); LOG.debug("Bootstrapped import"); LOG.trace("Bootstrapping index ..."); indexBootstrapper.bootstrap(); LOG.debug("Bootstrapped index"); LOG.trace("Populating entity type registry ..."); entityTypeRegistryPopulator.populate(); LOG.debug("Populated entity type registry"); LOG.trace("Populating bootstrap themes ..."); bootstrapThemePopulator.populate(); LOG.debug("Populated bootstrap themes"); bootstrappingEventPublisher.publishBootstrappingFinishedEvent(); LOG.info("Bootstrapping application completed"); }
Bootstrapper { @Transactional @RunAsSystem public void bootstrap(ContextRefreshedEvent event) { LOG.info("Bootstrapping application ..."); bootstrappingEventPublisher.publishBootstrappingStartedEvent(); LOG.trace("Updating MOLGENIS ..."); upgradeBootstrapper.bootstrap(); LOG.debug("Updated MOLGENIS"); LOG.trace("Populating data source with ACL tables ..."); dataSourceAclTablesPopulator.populate(); LOG.debug("Populated data source with ACL tables"); LOG.trace("Bootstrapping transaction exception translators ..."); transactionExceptionTranslatorRegistrar.register(event.getApplicationContext()); LOG.debug("Bootstrapped transaction exception translators"); LOG.trace("Bootstrapping registries ..."); registryBootstrapper.bootstrap(event); LOG.debug("Bootstrapped registries"); LOG.trace("Bootstrapping system entity meta data ..."); systemEntityTypeBootstrapper.bootstrap(event); LOG.debug("Bootstrapped system entity meta data"); LOG.trace("Populating repositories ..."); repositoryPopulator.populate(event); LOG.debug("Populated repositories"); LOG.trace("Populating permissions ..."); systemPermissionPopulator.populate(event.getApplicationContext()); LOG.debug("Populated permissions"); LOG.trace("Bootstrapping jobs ..."); jobBootstrapper.bootstrap(); LOG.debug("Bootstrapped jobs"); LOG.trace("Bootstrapping import ..."); importBootstrapper.bootstrap(); LOG.debug("Bootstrapped import"); LOG.trace("Bootstrapping index ..."); indexBootstrapper.bootstrap(); LOG.debug("Bootstrapped index"); LOG.trace("Populating entity type registry ..."); entityTypeRegistryPopulator.populate(); LOG.debug("Populated entity type registry"); LOG.trace("Populating bootstrap themes ..."); bootstrapThemePopulator.populate(); LOG.debug("Populated bootstrap themes"); bootstrappingEventPublisher.publishBootstrappingFinishedEvent(); LOG.info("Bootstrapping application completed"); } }
Bootstrapper { @Transactional @RunAsSystem public void bootstrap(ContextRefreshedEvent event) { LOG.info("Bootstrapping application ..."); bootstrappingEventPublisher.publishBootstrappingStartedEvent(); LOG.trace("Updating MOLGENIS ..."); upgradeBootstrapper.bootstrap(); LOG.debug("Updated MOLGENIS"); LOG.trace("Populating data source with ACL tables ..."); dataSourceAclTablesPopulator.populate(); LOG.debug("Populated data source with ACL tables"); LOG.trace("Bootstrapping transaction exception translators ..."); transactionExceptionTranslatorRegistrar.register(event.getApplicationContext()); LOG.debug("Bootstrapped transaction exception translators"); LOG.trace("Bootstrapping registries ..."); registryBootstrapper.bootstrap(event); LOG.debug("Bootstrapped registries"); LOG.trace("Bootstrapping system entity meta data ..."); systemEntityTypeBootstrapper.bootstrap(event); LOG.debug("Bootstrapped system entity meta data"); LOG.trace("Populating repositories ..."); repositoryPopulator.populate(event); LOG.debug("Populated repositories"); LOG.trace("Populating permissions ..."); systemPermissionPopulator.populate(event.getApplicationContext()); LOG.debug("Populated permissions"); LOG.trace("Bootstrapping jobs ..."); jobBootstrapper.bootstrap(); LOG.debug("Bootstrapped jobs"); LOG.trace("Bootstrapping import ..."); importBootstrapper.bootstrap(); LOG.debug("Bootstrapped import"); LOG.trace("Bootstrapping index ..."); indexBootstrapper.bootstrap(); LOG.debug("Bootstrapped index"); LOG.trace("Populating entity type registry ..."); entityTypeRegistryPopulator.populate(); LOG.debug("Populated entity type registry"); LOG.trace("Populating bootstrap themes ..."); bootstrapThemePopulator.populate(); LOG.debug("Populated bootstrap themes"); bootstrappingEventPublisher.publishBootstrappingFinishedEvent(); LOG.info("Bootstrapping application completed"); } Bootstrapper(
      MolgenisUpgradeBootstrapper upgradeBootstrapper,
      DataSourceAclTablesPopulator dataSourceAclTablesPopulator,
      TransactionExceptionTranslatorRegistrar transactionExceptionTranslatorRegistrar,
      RegistryBootstrapper registryBootstrapper,
      SystemEntityTypeBootstrapper systemEntityTypeBootstrapper,
      RepositoryPopulator repositoryPopulator,
      PermissionPopulator systemPermissionPopulator,
      JobBootstrapper jobBootstrapper,
      ImportBootstrapper importBootstrapper,
      IndexBootstrapper indexBootstrapper,
      EntityTypeRegistryPopulator entityTypeRegistryPopulator,
      BootstrapThemePopulator bootstrapThemePopulator,
      BootstrappingEventPublisher bootstrappingEventPublisher); }
Bootstrapper { @Transactional @RunAsSystem public void bootstrap(ContextRefreshedEvent event) { LOG.info("Bootstrapping application ..."); bootstrappingEventPublisher.publishBootstrappingStartedEvent(); LOG.trace("Updating MOLGENIS ..."); upgradeBootstrapper.bootstrap(); LOG.debug("Updated MOLGENIS"); LOG.trace("Populating data source with ACL tables ..."); dataSourceAclTablesPopulator.populate(); LOG.debug("Populated data source with ACL tables"); LOG.trace("Bootstrapping transaction exception translators ..."); transactionExceptionTranslatorRegistrar.register(event.getApplicationContext()); LOG.debug("Bootstrapped transaction exception translators"); LOG.trace("Bootstrapping registries ..."); registryBootstrapper.bootstrap(event); LOG.debug("Bootstrapped registries"); LOG.trace("Bootstrapping system entity meta data ..."); systemEntityTypeBootstrapper.bootstrap(event); LOG.debug("Bootstrapped system entity meta data"); LOG.trace("Populating repositories ..."); repositoryPopulator.populate(event); LOG.debug("Populated repositories"); LOG.trace("Populating permissions ..."); systemPermissionPopulator.populate(event.getApplicationContext()); LOG.debug("Populated permissions"); LOG.trace("Bootstrapping jobs ..."); jobBootstrapper.bootstrap(); LOG.debug("Bootstrapped jobs"); LOG.trace("Bootstrapping import ..."); importBootstrapper.bootstrap(); LOG.debug("Bootstrapped import"); LOG.trace("Bootstrapping index ..."); indexBootstrapper.bootstrap(); LOG.debug("Bootstrapped index"); LOG.trace("Populating entity type registry ..."); entityTypeRegistryPopulator.populate(); LOG.debug("Populated entity type registry"); LOG.trace("Populating bootstrap themes ..."); bootstrapThemePopulator.populate(); LOG.debug("Populated bootstrap themes"); bootstrappingEventPublisher.publishBootstrappingFinishedEvent(); LOG.info("Bootstrapping application completed"); } Bootstrapper(
      MolgenisUpgradeBootstrapper upgradeBootstrapper,
      DataSourceAclTablesPopulator dataSourceAclTablesPopulator,
      TransactionExceptionTranslatorRegistrar transactionExceptionTranslatorRegistrar,
      RegistryBootstrapper registryBootstrapper,
      SystemEntityTypeBootstrapper systemEntityTypeBootstrapper,
      RepositoryPopulator repositoryPopulator,
      PermissionPopulator systemPermissionPopulator,
      JobBootstrapper jobBootstrapper,
      ImportBootstrapper importBootstrapper,
      IndexBootstrapper indexBootstrapper,
      EntityTypeRegistryPopulator entityTypeRegistryPopulator,
      BootstrapThemePopulator bootstrapThemePopulator,
      BootstrappingEventPublisher bootstrappingEventPublisher); @Transactional @RunAsSystem void bootstrap(ContextRefreshedEvent event); }
Bootstrapper { @Transactional @RunAsSystem public void bootstrap(ContextRefreshedEvent event) { LOG.info("Bootstrapping application ..."); bootstrappingEventPublisher.publishBootstrappingStartedEvent(); LOG.trace("Updating MOLGENIS ..."); upgradeBootstrapper.bootstrap(); LOG.debug("Updated MOLGENIS"); LOG.trace("Populating data source with ACL tables ..."); dataSourceAclTablesPopulator.populate(); LOG.debug("Populated data source with ACL tables"); LOG.trace("Bootstrapping transaction exception translators ..."); transactionExceptionTranslatorRegistrar.register(event.getApplicationContext()); LOG.debug("Bootstrapped transaction exception translators"); LOG.trace("Bootstrapping registries ..."); registryBootstrapper.bootstrap(event); LOG.debug("Bootstrapped registries"); LOG.trace("Bootstrapping system entity meta data ..."); systemEntityTypeBootstrapper.bootstrap(event); LOG.debug("Bootstrapped system entity meta data"); LOG.trace("Populating repositories ..."); repositoryPopulator.populate(event); LOG.debug("Populated repositories"); LOG.trace("Populating permissions ..."); systemPermissionPopulator.populate(event.getApplicationContext()); LOG.debug("Populated permissions"); LOG.trace("Bootstrapping jobs ..."); jobBootstrapper.bootstrap(); LOG.debug("Bootstrapped jobs"); LOG.trace("Bootstrapping import ..."); importBootstrapper.bootstrap(); LOG.debug("Bootstrapped import"); LOG.trace("Bootstrapping index ..."); indexBootstrapper.bootstrap(); LOG.debug("Bootstrapped index"); LOG.trace("Populating entity type registry ..."); entityTypeRegistryPopulator.populate(); LOG.debug("Populated entity type registry"); LOG.trace("Populating bootstrap themes ..."); bootstrapThemePopulator.populate(); LOG.debug("Populated bootstrap themes"); bootstrappingEventPublisher.publishBootstrappingFinishedEvent(); LOG.info("Bootstrapping application completed"); } Bootstrapper(
      MolgenisUpgradeBootstrapper upgradeBootstrapper,
      DataSourceAclTablesPopulator dataSourceAclTablesPopulator,
      TransactionExceptionTranslatorRegistrar transactionExceptionTranslatorRegistrar,
      RegistryBootstrapper registryBootstrapper,
      SystemEntityTypeBootstrapper systemEntityTypeBootstrapper,
      RepositoryPopulator repositoryPopulator,
      PermissionPopulator systemPermissionPopulator,
      JobBootstrapper jobBootstrapper,
      ImportBootstrapper importBootstrapper,
      IndexBootstrapper indexBootstrapper,
      EntityTypeRegistryPopulator entityTypeRegistryPopulator,
      BootstrapThemePopulator bootstrapThemePopulator,
      BootstrappingEventPublisher bootstrappingEventPublisher); @Transactional @RunAsSystem void bootstrap(ContextRefreshedEvent event);  }