Initializer module and Integration Tests

Tags: #<Tag:0x00007fa3ef70cdb8> #<Tag:0x00007fa3ef70ccf0> #<Tag:0x00007fa3ef70cbd8>

Dear @mksd We use Initializer module to load all configurations data (concepts, encounter types, locations…) Actually, we want to write some integration tests to validate some calculation reports. Before to run those tests, we need to create a set of data (patients, visits, forms…) and it assumes that configs are already loaded. I have tow questions there :

  1. What is the best way to load examples data ? It would be nice if Iniz allow to do that
  2. Is there any way to call Initializer API to load all configs during the build/tests phase ?

Thanks a lot for your time,


Hi @amine,

  1. No Iniz only loads metadata, not data.
  2. Yes, you can use Iniz Java API in your Spring tests, you just have to make it a test-scoped dependency of your module.
1 Like

By loading a test data set, such as this one.

1 Like

Hi @mksd , To load data using datset we need to use this method executeDataSet as described in the Wiki.

Do you think that we can use that method outside test-scope ? for example to import some existing data to openmrs …

Thanks Amine

No, but I thought all that you did would be integration tests?

Yes, but the problem is that liquibase changes I have can not work on H2. So, I am looking on how to run my tests over real database and in the same time use dataset logic to load my test data.

any recommandation about that ?

Thanks amine