Spring Boot 3.2.1
Java 17
H2 Database
Custom Exception handling
unit test
Start the application using any of the below mentioned command
Note: command need to run inside the root folder of this project
-
using maven
mvn spring-boot:run
-
from jar file Create a jar file using 'mvn clean install' command and then execute
java -jar target/rest-demo-0.0.1-SNAPSHOT.jar
-
Browser or REST client
http://localhost:8080/api/transaction/1
Body{ "transactionId": "123456789", "accountNumber": "545343423" }
-
cURL
curl --location --request POST 'http://localhost:8080/api/transaction/save' \ --header 'Content-Type: application/json' \ --data-raw '{ "transactionId": "123456789", "accountNumber": "545343423" }'
Run the test cases using any of the commands mentioned below
Note: These commands need to run inside the root folder of this project i.e inside the rest-demo folder
-
To run all the test cases
mvn test
-
To run a particular test class
mvn -Dtest=RestDemoApplicationTests test
ormvn -Dtest=TransactionControllerTest test