Creating directory in Openmrs dir of Appdata

@dkayiwa I don’t really know whats really going on hear but even when I do it out of the constructor, its actually the same thing. And btw, for sync2, it actually creates it from the constructor

cc: https://github.com/openmrs/openmrs-module-sync2/blob/master/api/src/main/java/org/openmrs/module/sync2/api/impl/SyncConfigurationServiceImpl.java#L37

And it works as expected

The bean in sync is instantiated differently from yours. When you took it out of the constructor, where did you put it?

I’m failing to understand how different it is. And which bean to be specific @dkayiwa

Did you try doing what i told you? That is, not calling that method from the constructor?

@dkayiwa I put all the logic here (out of the constructor) then tested it

https://github.com/samuelmale/openmrs-module-mergepatientdata/blob/master/api/src/test/java/org/openmrs/module/mergepatientdata/api/MergePatientDataConfigurationServiceTest.java#L17-L20

but still the problem persists

If you are calling this from a unit test, then you need to use what @mseaton told you.

Looks like I didn’t understand @mseaton’s advice but at a fifth glance, I atlast understood him. Cool am now good thanks @dkayiwa