Skip to content

About

devsu-demo-devops-java

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

9 Commits

Folders and files

Repository files navigation

Demo Devops Java

This is a simple application to be used in the technical test of DevOps.

Getting Started

Prerequisites

  • Java Version 17
  • Spring Boot 3.0.5
  • Maven

Installation

Clone this repo.

git clone https://bitbucket.org/devsu/demo-devops-java.git

Database

The 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.

Usage

To run tests you can use this command.

mvn clean test

To run locally the project you can use this command.

mvn spring-boot:run

Open http://127.0.0.1:8000/api/swagger-ui.html with your browser to see the result.

Features

These services can perform,

Create User

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"
    ]
}

Get Users

To get all users, the endpoint /api/users must be consumed with the following parameters:

  Method: GET

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"
    }
]

Get User

To get an user, the endpoint /api/users/ must be consumed with the following parameters:

  Method: GET

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 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"
    ]
}

License

Copyright © 2023 Devsu. All rights reserved.

About

devsu-demo-devops-java

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages