Skip to content

mate-academy/springboot-webmvc-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WebMVC test example

What is covered in this example?

You can find the following examples:

  1. How to mock DB for tests. There is configured MySQL DB for main project and in memory H2 DB for tests.
  2. How to send POST request to you controller and validate the response
  3. How to send GET request, receive the response object and validate the response
  4. How to test custom repository method. See UserRepositoryTest class

How to launch?

  1. Replace your MySQL connection properties in the src/main/resources/application.properties
  2. Run project

How to check tests works?

  1. Run all tests from `src/test/java

Important

  1. PLease note we are not using service layer in this example. This example is required to show of how to test the controller layer.
  2. Please note we are performing the business logic in the controller. Don't do it in your test tasks or in real projects.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages