This is a solution for the Etraveli Refactoring Java assignment. the solution uses SpringBoot, Mysql, REST API to refactor the code.
-
run the command below in the folder of the file docker-compose.yml(also the root folder of the project) to boot up the Mysql service in docker.
docker compose up -
run the MainApplication class in Intellj to boot up the SpringBoot service,
or a) execute the command below to package the project in the root folder of the project:
mvn clean packageb) execute the below command to run the prject:
java -jar target/tax-calculater-0.0.1-SNAPSHOT.jar -
and you can use the swagger-ui to send request to test the restapi interface via the link:
http://localhost:8080/swagger-ui/index.html -
you could calculate the expnese and freequencyEnterPoints by the link below:
http://localhost:8080/swagger-ui/index.html#/order-controller/createOrderthe request body is included in the file below in the project
/resources/request/createOrder.json
the integration test uses TestContainer to launch a new Mysql service in docker, and directly run the OrderTest class to run all the tests.