Every now and then we have to bootstrap data in our application. It takes lot of time thinking what name to give, what description to add and other stuff.
To overcome this, we can use faker plugin which can generate random tokens as per your need.
To use this, add following in BuildConfig.groovy
compile ":faker:0.6"
And in BootStrap.groovy(or wherever we want to use it), just inject fakerservice:
def fakerService
It gives us options to generate name, city, zip code, sentences with given word count, paragraphs with predefined sentence count and a lot more.
Some samples:
fakerService.name() -- Santos Koelpin fakerService.city() -- West Domenic fort fakerService.zipCode() -- 60985 fakerService.sentence(10) -- Et quod expedita in qui eligendi est error quos eos aperiam quia libero
It saves a lot of time that we spend while bootstrapping data.
It helped me a lot.
Hope it helps you too.
Regards.
Vivek Sachdeva
vivek.sachdeva@intelligrape.com
Twitter : @vivek_sach

