Skip to content

Brest-Java-Course-2021-2/Vladimir-Petranovski-multimodule

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

87 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Java CI with Maven

Brest Java Course 2021 2

Vladimir-Petranovski-MD-SpringBoot

This is sample 'Motor depot' web application.

Project Information

Technology Stack

Requirements

  • JDK 11+
  • Git 2.25.1+
  • Apache Maven 3.6.3+

Build application:

$ git clone https://github.com/Brest-Java-Course-2021-2/Vladimir-Petranovski-MD-SpringBoot
$ cd Vladimir-Petranovski-MD-SpringBoot
$ mvn clean install

Run tests:

$ mvn clean test

Run integration tests:

$ mvn clean verify

Run project information ( coverage, dependency, etc. ):

$ mvn site
$ mvn site:stage
Open in browser: ./target/staging/index.html

Rest server

Start Rest using Maven Jetty plugin

To start Rest using Maven Jetty plugin use:

$ cd rest-app
$ mvn jetty:run

Web

Start Web using Maven Jetty plugin

To start Web using Maven Jetty plugin use:

$ cd web-app
$ mvn jetty:run

Available REST endpoints

version

$ curl --request GET 'http://localhost:8088/version'

drivers_dto

$ curl --request GET 'http://localhost:8088/drivers_dto'

Pretty print json:

$ curl --request GET 'http://localhost:8088/drivers_dto' | json_pp

drivers

findAll

$ curl --request GET 'http://localhost:8088/drivers' | json_pp

findById

$ curl --request GET 'http://localhost:8088/drivers/1' | json_pp

create

$ curl --request POST 'http://localhost:8088/drivers' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data-raw '{
"driverName": "TOLIA",
"driverDateStartWork": 1214677490.532700000,
"driverSalary": 980
}'

update

$ curl --request PATCH 'http://localhost:8088/drivers/3' \
--header 'Content-Type: application/json' \
--data-raw '{
"driverName": "SERGEI",
"driverDateStartWork": 1014677990.532700000,
"driverSalary": 470
}'

delete

$ curl --request DELETE 'http://localhost:8088/drivers/3/delete-driver'

cars

findAll

$ curl --request GET 'http://localhost:8088/cars' | json_pp

findById

$ curl --request GET 'http://localhost:8088/cars/1' | json_pp

create

$ curl --request POST 'http://localhost:8088/cars' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data-raw '{
"carModel": "GIGULI",
"driverId": 2
}'

update

$ curl --request PATCH 'http://localhost:8088/cars/3' \
--header 'Content-Type: application/json' \
--data-raw '{
"carModel": "AUDI",
"driverId": 1
}'

delete

$ curl --request DELETE 'http://localhost:8088/cars/3/delete-car'

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published