Skip to content

reachansari/spring-boot-testing-mock-mvc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

spring-boot-testing-mock-mvc

This project depicts how to write JUnit test cases for Spring boot REST APIs

Rest Controller

The class StudentController.java contains all endpoint.

AVAILABLE ENDPOINTS

method resource description
GET /getMapping get the collection of students -> 200(OK)
POST /postMapping creates a student record -> 201(created)
PUT /putMapping updates a student record -> 200(OK)
DELETE /deleteMapping deletes a student record -> 200(OK)

Libraries used

  • Spring Boot
  • Spring Configuration
  • Spring REST Controller
  • JUnit 5
  • Development Tools

Junit

  • This app has mockmvc for the 4 endpoints

Compilation Command

  • mvn clean install - Plain maven clean and install

Medium Article

About

A simple REST controller and some unit tests using Spring MockMVC

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages