This is a simple application to be used in the technical test of DevOps.
- Java Version 17
- Spring Boot 3.0.5
- Maven
Clone this repo.
git clone https://bitbucket.org/devsu/demo-devops-java.gitThe database is generated as a file in the main path when the project is first run, and its name is test.mv.db.
Consider giving access permissions to the file for proper functioning.
To run tests you can use this command.
mvn clean testTo run locally the project you can use this command.
mvn spring-boot:runOpen http://127.0.0.1:8000/api/swagger-ui.html with your browser to see the result.
These services can perform,
To create a user, the endpoint /api/users must be consumed with the following parameters:
Method: POST{
"dni": "dni",
"name": "name"
}If the response is successful, the service will return an HTTP Status 200 and a message with the following structure:
{
"id": 1,
"dni": "dni",
"name": "name"
}If the response is unsuccessful, we will receive status 400 and the following message:
{
"errors": [
"error"
]
}To get all users, the endpoint /api/users must be consumed with the following parameters:
Method: GETIf the response is successful, the service will return an HTTP Status 200 and a message with the following structure:
[
{
"id": 1,
"dni": "dni",
"name": "name"
}
]To get an user, the endpoint /api/users/ must be consumed with the following parameters:
Method: GETIf the response is successful, the service will return an HTTP Status 200 and a message with the following structure:
{
"id": 1,
"dni": "dni",
"name": "name"
}If the user id does not exist, we will receive status 404 and the following message:
{
"errors": [
"User not found: <id>"
]
}If the response is unsuccessful, we will receive status 400 and the following message:
{
"errors": [
"error"
]
}Copyright © 2023 Devsu. All rights reserved.