2019-11-26 11:59:51 -05:00
|
|
|
## Spring REST Testing
|
2019-10-17 12:17:31 -04:00
|
|
|
|
2019-11-26 11:59:51 -05:00
|
|
|
This module contains articles about testing REST APIs with Spring
|
2019-10-17 12:17:31 -04:00
|
|
|
|
|
|
|
### Courses
|
|
|
|
|
|
|
|
The "REST With Spring" Classes: http://bit.ly/restwithspring
|
|
|
|
|
|
|
|
The "Learn Spring Security" Classes: http://github.learnspringsecurity.com
|
|
|
|
|
|
|
|
### Relevant Articles:
|
2020-07-21 08:53:15 -04:00
|
|
|
|
2019-10-17 12:17:31 -04:00
|
|
|
- [Integration Testing with the Maven Cargo plugin](https://www.baeldung.com/integration-testing-with-the-maven-cargo-plugin)
|
2020-07-21 08:53:15 -04:00
|
|
|
- [Testing Exceptions with Spring MockMvc](https://www.baeldung.com/spring-mvc-test-exceptions)
|
2019-10-17 12:17:31 -04:00
|
|
|
|
|
|
|
### Build the Project
|
|
|
|
```
|
|
|
|
mvn clean install
|
|
|
|
```
|
|
|
|
|
|
|
|
### Set up MySQL
|
|
|
|
```
|
|
|
|
mysql -u root -p
|
|
|
|
> CREATE USER 'tutorialuser'@'localhost' IDENTIFIED BY 'tutorialmy5ql';
|
|
|
|
> GRANT ALL PRIVILEGES ON *.* TO 'tutorialuser'@'localhost';
|
|
|
|
> FLUSH PRIVILEGES;
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
### Use the REST Service
|
|
|
|
|
|
|
|
```
|
|
|
|
curl http://localhost:8082/spring-rest-full/auth/foos
|
|
|
|
```
|