An open API service indexing awesome lists of open source software.

https://github.com/vindhya733/employee-rest-service

Spring Boot REST API for managing employee data with JUnit tests
https://github.com/vindhya733/employee-rest-service

employee java junit management maven restapi springboot

Last synced: 3 months ago
JSON representation

Spring Boot REST API for managing employee data with JUnit tests

Awesome Lists containing this project

README

          

# Employee REST Service

A Spring Boot REST API that manages employee data with support for:
- Retrieving employee records via HTTP GET
- Adding new employees via HTTP POST
- Unit testing using JUnit and Spring Boot Test framework

## Features

- ๐Ÿ“‹ Add and retrieve employee details
- โœ… Unit tests using `@SpringBootTest` and `TestRestTemplate`
- ๐Ÿงช Tests validate API endpoints and ensure application reliability

## Tech Stack

- Java 17+
- Spring Boot
- Maven
- JUnit 5
- Spring Boot Test
- VS Code / IntelliJ

## Project Structure

src/
โ”œโ”€โ”€ main/
โ”‚ โ””โ”€โ”€ java/
โ”‚ โ””โ”€โ”€ com/example/demo/
โ”‚ โ”œโ”€โ”€ Employee.java
โ”‚ โ”œโ”€โ”€ EmployeeController.java
โ”‚ โ”œโ”€โ”€ EmployeeManager.java
โ”‚ โ”œโ”€โ”€ Employees.java
โ”‚ โ””โ”€โ”€ RestServiceApplication.java
โ”œโ”€โ”€ test/
โ”‚ โ””โ”€โ”€ java/
โ”‚ โ””โ”€โ”€ com/example/demo/
โ”‚ โ””โ”€โ”€ EmployeeControllerTest.java

## How to Run

1. **Clone the repository**

git clone https://github.com/Vindhya733/employee-rest-service.git
cd employee-rest-service

2. **Build the project**
mvn clean install

4. **Run the application**
mvn spring-boot:run

6. **Access endpoints**
POST /employees โ€” Add a new employee

## Run Tests
To run all unit tests:
mvn test

## License
This project is for educational/demo purposes only.