This is a simple Drools rule example using Spring boot REST API's. Dependency details can be found in build.gradle file. Cucumber BDD is used for unit and rest level testing.
Analyzes a given integer and determines whether or not it is an Armstrong
number. Final decision is made using simple Drools rule.
An Armstrong number is an n-digit number that is equal to the sum
of the n'th powers of its digits. E.g. 153 = 1^3 + 5^3 + 3^3
From service root directory where we have build.gradle
and run: ./gradlew clean build
. It uses cucumber
BDD tests to verify.
- Start your service as simple java application using
java -jar armstrong-ws/build/libs/armstrong.1.0.0.SNAPSHOT-boot.jar
options- You can right click
ArmstrongApplication.java
class from armstrong-ws module and hitRun ArmstrongApplication
in IDE.
- You can view the api documentation on swagger-ui by pointing to
http://localhost:8080/<context-root>/api