- Overview
- Conditions
- Tech Stack
- Prerequisites
- Operations
- API Documentation
- Database
- Security
- Getting Started
- Running Tests
- Postman Collection
- cURL
- Docker
Welcome to the TUI DX Backend Technical Test v2. This project is designed to evaluate your skills in backend development using Java, Spring Boot, and related technologies.
- Create a pilotes order (5, 10, or 15 pilotes).
- Update a pilotes order within 5 minutes of creation.
- Search orders by customer name with partial matching.
- Data validation.
- Secured search operation, other operations are public.
- Java: Core programming language.
- Spring Boot: Framework for building microservices.
- Spring Data JPA: Data access framework.
- Spring Security: Authentication and authorization framework.
- H2: In-memory database.
- Gradle: Build automation tool.
- Lombok: Reduces boilerplate code.
- Swagger: API documentation.
- Spock: Testing and specification framework.
- Jacoco: Code coverage tool.
- Checkstyle: Code quality tool.
- Veracode: Security scanning tool.
- SonarLint: Static code analysis tool.
- Docker: Containerization tool.
Ensure you have the following installed:
- Java 11 or higher
- Gradle 6.9.4 or higher
- Lombok (Follow the installation guide)
- Docker
Details of the operations are as follows:
| Operation | Method | Description |
|---|---|---|
| /orders | POST | Create a pilotes order |
| /orders/{id} | PUT | Update a pilotes order |
| /orders/search | GET | Search orders by customer info |
The API documentation is available at
- Swagger UI: http://localhost:8080/swagger-ui.html.
- OpenAPI Docs: http://localhost:8080/v3/api-docs.
The H2 database console is available at http://localhost:8080/h2-console.
- jdbc url: jdbc:h2:mem:testdb
- username: admin
- password: admin
- Search Operation: Secured, requires authentication (demo user - user/user).
- Create and Update Operations: Public, no authentication required.
-
Clone the repository: (If you use bundle file, skip this step)
git clone https://github.com/aandmaldonado/backend-technical-test-v2.git cd backend-technical-test-v2 -
Build the project:
./gradlew build
-
Run the application:
./gradlew bootRun
To execute the tests, run:
./gradlew testTo check code coverage, run:
./gradlew jacocoTestReportThe coverage report will be generated in build/reports/jacoco/test/html/index.html.
You can find the Postman collection to test the APIs here.
- Create Order:
curl --location 'localhost:8080/orders' \
--header 'Content-Type: application/json' \
--data '{
"client": {
"firstName": "Álvaro",
"lastName": "Maldonado",
"telephone": "+34641962396"
},
"deliveryAddress": {
"city": "Gandia",
"street": "Carrer de França 12",
"postcode": "46730",
"country": "Spain"
},
"pilotes": "5"
}'- Update Order:
curl --location --request PUT 'localhost:8080/orders/1' \
--header 'Content-Type: application/json' \
--data '{
"client": {
"firstName": "Álvaro",
"lastName": "Maldonado",
"telephone": "+34641962396"
},
"deliveryAddress": {
"city": "Gandia",
"street": "Carrer de França 12",
"postcode": "46730",
"country": "Spain"
},
"pilotes": "5"
}'- Search Order:
curl --location 'localhost:8080/orders/search?filter=%C3%81lva' \
--header 'Authorization: Basic dXNlcjp1c2Vy' \
--header 'Cookie: JSESSIONID=8858AD0BFADC46B74E237F686474909C' \
--data ''To run the application in Docker, follow these steps:
- Build local project:
./gradlew build
- Build Docker image:
docker-compose build
- Run Docker container:
docker-compose up
