Do we have access to all the functions from faker library?
Looks like for templating mocks, Microcks is using java-fake, is it possible to use any of their functions? or is it limited to a supported set?
Hi @hguerrero
Correct: we're using java-fake underhood.
For integrating a new function, we need to write a simple wrapper like in RandomCityELFunction. The wrapper should then be registered into the TemplateEngineFactory.
So we actually have a limited supported set but it's very easy to add new ones ;-)
Would it be possible to somehow dynamically try to access the underlying library for the functions to avoid this registration?
Great idea! Maybe having a fallback that in case of unsupported function call tries to use reflection for java-fake invocation... It's a nice RFE.
Any candidate for this one? It shouldn't be that difficult using basic Java reflection. It's a low hanging fruit 😉
Greetings @lbroudoux ! I'm a beginner and any insights or resources on how can I solve this issue would be of great help. I'd like to contribute, thanks!
The starting idea would have been to have something like GenericFakerELFunction that would have allowed on evaluation of $randomLorem (for example) to understand that it has to invoke faker.lorem().
Thinking about it again, I don't really know if reflection is the way to go, as I don't think we have the function name at hand when evaluating the function. We may have its arguments only...
Maybe the first thing to do would be to have a review of existing faker functions and see them that is missing in Microcks in order to see how many util ones are actually missing. Depending on the number we can decide to go with static function types or think again about a more dynamic mechanism.