API for create and find people.
Create a POC application for an API using Spring Native, Spring Web, Spring Data and Spring Validation.
With these dependencies it was possible to create an API that create and find a person.
The project is composed of the domain module and the application module.
Although there are tests, @MockBean is not supported by Spring AOT.
To build the project is necessary to have GRAALVM correctly configured.
Then run the command below.
mvn -Pnative -DskipTests clean package
❗ Use -DskipTests for prevents tests from being called and this way can compile without any problems.
After the build, the artifact will be available at: /application/target/
Just run the application artifact
./application
GET /v1/person/1 HTTP/1.1
Content-Type: application/json
Host: localhost:8080
POST /v1/person HTTP/1.1
Content-Type: application/json
Host: localhost:8080
Content-Length: 37
{
"name": "User Test2",
"age": 18
}