Some years ago I have written a price logic using mini expressions and then creating javascript in Java to evaluate. For example in a column "amount" one could type ">100" and in the price column "10", meaning that if you sell more than 100 units, the unit price would become 10 dollars. I would generate javascript in the form of "if (amount > 100) return 10" en execute that dynamically. Works fine and the flexibility is very appreciated by the users.
Now I need to do something similar and am considering using Gherkin:
When amount > 100
Then unit price is 10 USD
So not asserting business rules, but actually writing them in Gherkin. Has anyone tried this before?
What is the appropriate class to use in Cucumber-JVM to manually run such features?