Tutorial by AlgaWorks.
From the YouTube description:
"In this video we will teach you how to unit test Controllers using Spring.
For that, we will use Rest Assured and Spring MockMVC tools together with JUnit5."
- Project: Maven
- Java: 11
- Spring Boot: 2.4.5
- Dependencies
- Spring Web
- Spring Boot DevTools
- Lombok
- Spring Boot Starter Test
- Spring MockMVC
- Spring Security
- Bucket4j Spring Boot Starter
- Spring Cache Abstraction
- Ehcache
- Plugins
- Spring Boot Maven Plugin
- Heroku Maven Plugin
Retrieves a movie.
GET /filmes/:id
id
must be between 0 and 100- the response is the same, regardless of
id
{
"codigo": 1,
"titulo": "movie-title",
"descricao": "movie-description"
}
Condition | Error |
---|---|
id < 0 |
400 BAD REQUEST |
id > 100 |
404 NOT FOUND |
App deployed on Heroku