The Operations API manages mathematical operations, including cost deduction and user balance verification. It is part of a microservices system and depends on the Authentication API to validate users.
- Java 17
- Spring Boot 3.3.4: Framework for building REST applications.
- JUnit: For unit testing the API's functionalities.
- Maven: Build and dependency management.
The API starts on port 8082 by default.
- Mathematical Operations: Performs calculations, deducting values from user balance.
- Balance Verification: Checks and validates user balance before performing operations.
POST /api/operations
: Performs a mathematical operation.GET /api/balance
: Checks the current balance of a user.
- Clone the repository.
- In the
operations
directory, run:./mvnw clean install
Start the API with: ./mvnw spring-boot:run
Unit Tests The API includes unit tests implemented with JUnit to validate key functionalities, including: .Execution of mathematical operations. .Verification and updating of user balance.
To run the tests: ./mvnw test