Skip to content

Instantly share code, notes, and snippets.

@jluismm2311
Created September 2, 2020 16:08
Show Gist options
  • Save jluismm2311/45baf4338320b4e0aeffa67ce27af0a6 to your computer and use it in GitHub Desktop.
Save jluismm2311/45baf4338320b4e0aeffa67ce27af0a6 to your computer and use it in GitHub Desktop.
Interview rest test
Construir una api REST, para hacer altas, bajas cambios de usuarios, documentar la API.
Utilizar las siguientes tecnologias.
* Spring Boot
* PostgreSQL hibernate o Gorm
* Gradle
La aplicacion debe de estar versionada en GitHub y de correr con el comando: gradle bootRun
Se va a correr una prueba funcional a la API.
Referencias
https://json-schema-validator.herokuapp.com/
http://json-schema.org/
La API debe de aceptar un objeto que sea valido con el siguiente JSON-Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id" : "user.schema.json",
"title": "User",
"description": "A user from OSO's catalog",
"type": "object",
"properties": {
"id": {
"description": "The unique identifier for a user",
"type": "string"
},
"name": {
"description": "Name of the person",
"type": "string",
"minLength" : 3,
"maxLength" : 100
},
"firstSurname": {
"description": "First surname of the person, also called LastName",
"type": "string",
"minLength" : 3,
"maxLength" : 100
},
"secondSurname": {
"description": "Second surname of the person, for Hispanic names",
"type": "string",
"minLength" : 3,
"maxLength" : 100
},
"email":{
"description": "Email of the person",
"type": "string",
"format": "email",
"maxLength" : 120
},
"phone":{
"description": "The phone of the user just digits",
"type" : "string",
"pattern" : "^\\d+$",
"maxLength" : 20
},
"companyId":{
"description": "The company id",
"type": "string"
},
"password":{
"description": "Password of the person, the password is only needed when creating a user",
"type": "string",
"minLength" : 6,
"maxLength" : 50
},
"emailValidated":{
"description": "True when the System has validated the account",
"type": "boolean"
},
"accountLocked":{
"description": "True when the System has locked the account",
"type": "boolean"
},
"passwordExpired":{
"description": "True when the System has expired the password",
"type": "boolean"
},
"organizations_url":{
"description": "URL to get user's organization",
"type": "string"
}
},
"required": ["id", "name", "firstSurname", "email", "password"]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment