online-auction-java
online-auction-java copied to clipboard
Pre-load a few users and items
It is cumbersome to create multiple users and at least one item before you can actually exercise the app and bid on something. It would be nice to add a script that loads a few users and items so that someone who downloads and runs online auction could observe the main functionality right away. They could still add other users and items if they wish.
@rstento @TimMoore So should we pull it depending on if it is in development env then run that script on base of env var?
We can check if it's dev mode using this Play API: https://playframework.com/documentation/2.5.7/api/java/play/Environment.html#mode--
Here's an example in the Lagom framework: https://github.com/lagom/lagom/blob/7956d9b3532ff79c9247182de92fe43d94270cc9/logback/src/main/scala/com/lightbend/lagom/internal/logback/LogbackLoggerConfigurator.scala#L58
The Environment
can be injected into a class constructor. The only question is what would be the best place to put all of the setup code? Maybe in the web-gateway app? I'm not sure.
@rstento I will work on it soon
This library might be helpful https://github.com/DiUS/java-faker