Skip to content

This project demonstrates how to test Spring WebFlux controllers and services using JUnit 5 and Mockito.

Notifications You must be signed in to change notification settings

iammahesh123/spring-webflux-testing-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spring WebFlux Testing Demo

This project demonstrates how to test Spring WebFlux controllers and services using JUnit 5 and Mockito. It includes the following components:

  • UserController: REST controller responsible for handling user-related HTTP requests.
  • UserService: Service interface defining operations related to user management.
  • UserServiceImpl: Implementation of the UserService interface.
  • UserRepository: Reactive CRUD repository for managing user data.
  • UserControllerTest: JUnit 5 test class for testing UserController methods.
  • UserServiceTest: JUnit 5 test class for testing UserService methods.

Setup

To run this project locally, follow these steps:

  1. Clone the repository:

    git clone https://github.com/iammahesh123/spring-webflux-testing-demo.git
  2. Import the project into your preferred IDE.

  3. Run the JUnit tests located in the src/test/java directory.

Technologies Used

  • Java
  • Spring Reactive
  • Mongodb
  • JUnit 5
  • Mockito
  • Reactor

Usage

  1. Run the provided JUnit tests to ensure that the UserController and UserService are functioning as expected.

  2. Modify or extend the UserController and UserService as needed for your application requirements.

Contributions

Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or create a pull request.

License

This project is licensed under the MIT License.

Releases

No releases published

Packages

No packages published

Languages