This project implements a simple Math Operator service with a RESTful API to perform basic mathematical operations such as addition, subtraction, multiplication, and division.
The Math Operator service provides endpoints to perform mathematical operations on two operands. The project includes unit tests and integration tests to ensure the correctness of the implemented functionality.
- Java 8 or higher
- Maven
-
Clone the repository:
git clone https://github.com/your-username/ndungutse-term1-a.git
-
Navigate to the project directory:
cd ndungutse-term1-a
-
Build the project using Maven:
mvn clean install
The Math Operator service exposes the following API endpoints:
-
Addition:
POST /math/add
Request Body:
{ "operand1": 3.0, "operand2": 4.0, "operator": "+" }
-
Subtraction:
POST /math/subtract
Request Body:
{ "operand1": 7.0, "operand2": 3.0, "operator": "-" }
-
Multiplication:
POST /math/multiply
Request Body:
{ "operand1": 2.0, "operand2": 5.0, "operator": "*" }
-
Division:
POST /math/divide
Request Body:
{ "operand1": 20.0, "operand2": 4.0, "operator": "/" }
To run the tests, use the following Maven command:
mvn test
This will execute both unit tests and integration tests to ensure the correctness of the implemented functionality.
If you would like to contribute to this project, please follow the Contribution Guidelines.
This project is licensed under no license.