An application to register movies and tv shows watched. ๐ฌ๐ฟ
Author โ๏ธ: Gabriel Pivoto
This application consumes the OMDB API.
- Clone the repository:
https://github.com/GabrielPivoto/my-catalog.git
- Create the network:
docker network create inatel
- Start the MySql container:
docker container run --name mysql --network=inatel -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=my_catalog_db -p 3306:3306 -p 33060:33060 -d mysql
Now run the project in your IDE, and you're good to go.
- Clone the repository
- At the root of the project, run the command:
mvn clean install -DskipTests
- Also at the root of the project, build the application image:
docker build -t my-catalog .
- Run the Docker Compose file:
docker compose up
In this application, the user can register all movies and series he have already watched. It is possible to register a new movie/series; search movies and series that are registered; update movie/series; delete movie/series.
๐ฅ To add a new movie/series:
- POST
http://localhost:8080/show
- requires the following body:
{
"title": "showTitle",
"personalScore": score
}
๐ฅ To get all movies/series registered:
- GET
http://localhost:8080/show
- GET
http://localhost:8080/show/id
- gets a show by specific id - GET
http://localhost:8080/show?type=movie
- gets all movies registered - GET
http://localhost:8080/show?type=series
- gets all series registered
๐ฅ To update a movie/series:
- PATCH
http://localhost:8080/show
- requires the following body and updates only the personal score.
{
"title": "showTitle",
"personalScore": score
}
๐ฅ To remove a movie/series:
- DELETE
http://localhost:8080/show/id
- deletes a show by specific id
There are two test classes in the project: ShowControllerTest and ShowServiceTest . You can either run them from your IDE or run the following command at the root of the project:
mvn test
There's also two feature files regarding the methods GET and POST. To run these tests you just need to run the CucumberRunnerTests class. The test report can be accessed through this link: http://bit.ly/3IAalzy