Garage-SpringBoot

This repository contains Garage Application with Spring Boot,

Table of Contents

Technologies
Dependencies
Pre requirements
Download
Run Tests
Installing
Run Project
End Points
Postman Collection

Technologies

  • Java 11
  • Maven
  • Spring Boot
  • Lombok
  • H2 Database

Dependencies

  • Lombok
  • H2 Database

Pre requirements

  • JDK 11. version
  • Maven 4.0.0 version
  • git (optional)

Starting Project

  • You can download the project using powershell with command below.
    git clone https://github.com/selimsahin1/Garage-SpringBoot.git
    .

Run Tests

  • You can run test with command below.
    mvn clean compile test

Installing

  • First of all, the command below is need to be run before running the project.
    mvn clean install

Run Project

  • The project will be run with command below. Server port is 8080.
    java -jar ./target/carfactory-0.0.1-SNAPSHOT.jar

End Points

Create Ticket

localhost:8080/ticket/create

JSON Request:

{
    "color":"blue",
    "plate":"34MM0308",
    "vehicleType":"CAR"
}

JSON Response:

Allocated one slot.

Leave

localhost:8080/ticket/leave

JSON Request:

{
    "ticketId": 1
}

JSON Response:

1 slot is empty after removing ticket.

Status

localhost:8080/ticket/status

JSON Response:

[
    {
        "id": 2,
        "slots": [
            1
        ],
        "plate": "34MM0308",
        "color": "blue",
        "vehicleType": "CAR",
        "status": "INGARAGE"
    },
    {
        "id": 3,
        "slots": [
            0
        ],
        "plate": "34MM0308",
        "color": "blue",
        "vehicleType": "CAR",
        "status": "INGARAGE"
    },
    {
        "id": 4,
        "slots": [
            2
        ],
        "plate": "34MM0308",
        "color": "blue",
        "vehicleType": "CAR",
        "status": "INGARAGE"
    }
]

Postman Collection

  • Postman collection is in the project folder named Garage.postman_collection.json.